在我的应用程序中,我正在努力允许用户发送邀请。邀请有令牌。在电子邮件中,我使用路径中的令牌链接到注册页面。在邮件程序的控制器中,我正在使用:
new_user_registration_url(@invitation.token)
正如我在这个railscast中看到 Ryan Bates 所做的那样。但它似乎正在输出这种格式:
http://localhost:3000/signup.4a4aebcde29738a39c7f447f58817e49cf9b4cf4
为什么有一个“。” 代替 ”/”?
更新:
我正在使用设计,这里是相关的路线。我对这些没有信心;我曾为此苦苦挣扎,但这些似乎有效:
devise_scope :user do
get '/signup/:invitation_token' => "registrations#new", :as => :new_user_registration
end
devise_for :users, :controllers => { :registrations => "registrations"}, :skip => [:registrations]
as :user do
get '/users/cancel' => 'devise/registrations#cancel', :as => :cancel_user_registration
post '/users' => 'devise/registrations#create', :as => :user_registration
get '/signup' => 'registrations#new', :as => :new_user_registration
get '/users/edit' => 'devise/registrations#edit', :as => :edit_user_registration
put '/users' => 'devise/registrations#update'
delete '/users' => 'devise/registrations#destroy'
end