TL DR
I would like to change the default behavior of Rails-resourceful routing to move the create path for all resources so that it is POST to /resources/new and not /resources .
Customization
Suppose a resourceful route is specified as follows:
Actual routes to be created:
$ rake routes Prefix Verb URI Pattern Controller
NB that the create action is started by POST along the path /events .
Now, if I want to change this path, I can do it βmanuallyβ based on each resource:
Here are the generated routes:
$ rake routes Prefix Verb URI Pattern Controller
Excellent! The create action is now triggered by POST along the path /events/new , and not along the path /events .
Each other route / helper behaves exactly the same as before, including a GET for the /events/new and new_event path / URL helpers.
Question
Instead of manually overriding each create action, is there a way to change the default path used for this particular action?
Otherwise, what other means could I use to change the heap of resourceful routes so that their action is transferred to /new , as mentioned above?
Thanks!
source share