我在 rails 4.0.0 中使用设计认证。但我无法确认电子邮件,如果我尝试创建新用户,它会显示以下错误
ActionView::Template::Error (undefined method `confirmation_url' for #<# <Class:0xbbdb734>:0xbbdadfc>):
2:
3: <p>You can confirm your account email through the link below:</p>
4:
5: <p><%= link_to 'Confirm my account', confirmation_url(@resource, :confirmation_token => @resource.confirmation_token) %></p>
当我检查日志时,我发现确认部分不是从当前项目文件夹呈现,而是从呈现,
Rendered /home/shruthi/.rvm/gems/ruby-1.9.3-p327/gems/devise-3.0.3/app/views/devise/mailer/confirmation_instructions.html.erb (9.1ms)
设计 gem 的版本是
$ gem list devise
devise (3.0.3, 1.4.2)
路线是,
devise_for :users, :controllers => { :registrations => "users/registrations", :sessions => "users/sessions", :passwords => "users/passwords", :confirmations => "users/confirmations" }
Rake 路线如下所示,
$ rake routes
Prefix Verb URI Pattern Controller#Action
root GET / welcome#index
new_user_session GET /users/sign_in(.:format) users/sessions#new
user_session POST /users/sign_in(.:format) users/sessions#create
destroy_user_session DELETE /users/sign_out(.:format) users/sessions#destroy
user_password POST /users/password(.:format) users/passwords#create
new_user_password GET /users/password/new(.:format) users/passwords#new
edit_user_password GET /users/password/edit(.:format) users/passwords#edit
PATCH /users/password(.:format) users/passwords#update
PUT /users/password(.:format) users/passwords#update
cancel_user_registration GET /users/cancel(.:format) users/registrations#cancel
user_registration POST /users(.:format) users/registrations#create
new_user_registration GET /users/sign_up(.:format) users/registrations#new
edit_user_registration GET /users/edit(.:format) users/registrations#edit
PATCH /users(.:format) users/registrations#update
PUT /users(.:format) users/registrations#update
DELETE /users(.:format) users/registrations#destroy
user_confirmation POST /users/confirmation(.:format) users/confirmations#create
new_user_confirmation GET /users/confirmation/new(.:format) users/confirmations#new
GET /users/confirmation(.:format) users/confirmations#show