Monday, 12 August 2013

make a custom url for create action with RESTful routing

make a custom url for create action with RESTful routing

In Rails 4 I'm trying to make a custom root for a particular action in the
users controller, so i want my restful resources for users still like they
are, but change only the url for the create action and make it to be for
example /account/create. I'm trying do this as the follow but it seem not
work :
resources :users, except: [:create] # first i eliminate creation of create
root
resources :users, path: "account/create", as: :users, only: [:create] #
then i just try to make a custom route for only create action
i want still using users_path and not change any of my routing helper in
the view, please any idea ?

No comments:

Post a Comment