我正在尝试修改现有的设计路由以保存参数
以下是工作路线:
devise_for :contributors, controllers: {registrations: 'contributors/registrations', confirmations: 'contributors/confirmations'}工作路径:
<p><a href="<%= new_contributor_registration_path%>" class="btn btn-lg btn-primary" role="button">Create Account</a></p>我需要能够用它传递一个参数。有没有简单的方法可以做到这一点?
我在考虑做这样的事情:
devise_for :contributors, controllers: {registrations: 'contributors/registrations(/:contributor_type)', confirmations: 'contributors/confirmations'}
<p><a href="<%= new_contributor_registration_path(contributor_type: 'teacher') %>" class="btn btn-lg btn-primary" role="button">Create Account</a></p>但是不幸的是,它只返回这个错误:错误的常量名称注册(
发布于 2014-10-29 05:08:17
不要紧,我不需要在devise_for路由声明中放置参数。
devise_for :contributors, controllers: {registrations: 'contributors/registrations', confirmations: 'contributors/confirmations'}这很好地与
<p><a href="<%= new_contributor_registration_path(contributor_type: 'teacher') %>" class="btn btn-lg btn-primary" role="button">Create Account</a></p>https://stackoverflow.com/questions/26618372
复制相似问题