0
我使用类似于密码重置的代码,但我正在使用它来'取消''注册'。在这种情况下使用令牌的链接被邮寄给用户,并且他们点击链接,他们需要的东西像...我需要什么铁路路线?
3000/cancel_registration/3Z9XWXExzZ3BzrpooI5flA/edit
...在那里我有...
#app/views/cancel_registration/edit.html.erb
<td><%= link_to 'Yes. Cancel my Registration', cancel_registration_path(@registration) %></td>
...在我的控制器我有...
#app/controllers/cancel_registration_controller.rb
def edit
@registration = Registration.find_by_registration_cancellation_token!(params[:id])
end
def cancel
puts "made it to cancel"
end
...现在这里是我在我的控制器......
get 'cancel_registration', to: 'cancel_registration#new', as: 'cancel_registration'
post 'cancel_registration', to: 'cancel_registration#cancel', as: 'cancel_registration'
得到工作正常,但不知道如何从用户的视图取消行动?
Booya! Chika Chika哇!你钉住了市场......积分就是你的方式。 – Lumbee