Ruby-on-rails – How the customize or change the route paths in rails

ruby-on-railsruby-on-rails-3

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 ??

Best Answer

match '/posts/new' => 'posts#new', :as => :create_post in your routes should work!