【发布时间】:2026-02-02 15:25:01
【问题描述】:
我有一些这样的命名路线rake routes:
birthdays GET /birthdays(.:format) birthdays#index
在 rakefile 中,我只是希望能够像我认为的那样调用 birthdays_url。
task :import_birthdays => :environment do
url = birthdays_url
end
但我收到一个错误undefined local variable or method 'birthdays_url' for main:Object
【问题讨论】:
标签: ruby-on-rails rake rails-routing