For example consider the following output from rake routes:-
posts GET /posts(.:format) {:action=>"index", :controller=>"posts"}
posts POST /posts(.:format) {:action=>"create", :controller=>"posts"}
*new_post* GET /posts/new(.:format) {:action=>"new", :controller=>"posts"}
*edit_post* GET /posts/:id/edit(.:format) {:action=>"edit", :controller=>"posts"}
post GET /posts/:id(.:format) {:action=>"show", :controller=>"posts"}
If i want to change the path name of "new_post" to "create_post" how do I do it ??
match '/posts/new' => 'posts#new', :as => :create_post in your routes should work!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With