Rails 4.0,设计插件中的电子邮件确认问题

时间:2013-08-29 06:55:03

标签: ruby-on-rails devise confirmation

我在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)

Devise 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 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

0 个答案:

没有答案