位于 HomeController 中的 index 的视图中,有一段代码:
= form_for resource, controller => "devise", :as => resource_name, :url => session_path(resource_name), :class => "login ui fluid form" do |f|
.ui.inverted.dimmer
.ui.small.loader
.field
label for="email" E-mail
= f.email_field :email, :required => false, :autofocus => true, :tabindex => "1"
.field
a href="/forgot_password" class="forgot" target="_blank"
= t('user.forgot_password')
label for="password"
= t('user.password')
= f.password_field :password, :required => false, :tabindex => "2"
= f.submit t('user.login'), :class =>"fluid ui small submit button", :tabindex => "3"
运行提示找不到 resource 这的 method……但赶脚已经指定了 controller 了啊……为何还是不行……这段代码在 DeviseController 中可以正常使用