0

I have made a vanity url for a user signup page:

match 'signup' =>'users#new'

When there are errors and the controller action 'create' shows the form again, the url is users/create. Can I match signup to the create action as well? Also, the create action is posted to.

2 Answers 2

1

simply add :via

match 'signup' =>'users#new', :via => :get
match 'signup' =>'users#create', :via => :post
0

This also works and is a little bit shorter:

get 'signup' =>'users#new'
post 'signup' =>'users#create'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.