I am plan开发者_开发知识库ning on doing a reset_password functionality for my users.
Right now I am just working on the form. Right now I have one function reset_password. I want to make it so when a users does a POST to users/reset_password, it routes to the do_password_reset function.
Right now when they do a get, the form displays, but when they do a post I want to route it do a different action, is this possible?
Of course, see: http://guides.rubyonrails.org/routing.html#http-verb-constraints
match 'users/reset_password' => 'your_controller#reset_password', :via => :get
match 'users/reset_password' => 'your_controller#do_password_reset', :via => :post
精彩评论