Answer the question
In order to leave comments, you need to log in
Rails routes or how to get rid of match?
Hello!
If it creates an action that is triggered by a request, how to change to ?
So far I have this:resources :questions
new
GET
POST
match '/questions/new', to: 'questions#new', as: 'new_question', via: :post
Avoid using #match to define routes
Answer the question
In order to leave comments, you need to log in
post '/questions/new', to: 'questions#new', as: 'new_question'
resources
creates a set of specific routes . This is described in the documentation.
If you need to add a non-standard route, and - this is just the same, then you need to prescribe it additionally bypost :new
post '/questions/new', to: 'questions#new', as: 'new_question'
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question