0

如何使用另一个页面(不是默认)来编辑用户(设计 gem)?

我有这种情况:我需要一些页面来为用户添加属性,但我想使用 edit_user_registration - 我想使用另一个页面。

所以我需要在注册控制器中创建另一个动作并将其添加到 routes.rb 中。我还在registrations文件夹中创建了另一个文件,但我在实施时遇到了麻烦。

这是我的注册控制器:

   def paypal

   end

和 paypal.html.erb:

 <%= form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put }) do |d| %>
  <%= d.email_field :paypal_email %>
  ...
 <%end%>

问题:我应该在路由 rb 中写什么来调用贝宝操作和编辑页面正常工作?

   devise_for :users, :controllers => {:registrations => 'registrations', :sessions => 'sessions'} do 
     registrations#paypal//something here instead
   end
4

0 回答 0