我想创建一个链接来批准用户注册,
1)第一个解决方案
<%= link_to "Approve", edit_user_registration_path(:id => user.id, :approved => true), :method => :put %>
然而它回落No route matches [PUT] "/users/edit"
2)我还在考虑一个额外的动作,它将响应特定的路线并更新用户注册,比如说
匹配 '/users/approve_user', :controller => 'users', :action => 'approve_user', :collection => { :my_action => :put}在视图中:
%- link_to "批准", users_approve_user_path(:id => user.id), :method => :put
但是,它回馈了Couldn't find User with ID=approve_user
任何帮助将不胜感激