Created
October 19, 2011 11:50
-
-
Save lalala/1298072 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resources :users do | |
member do | |
resources :goals | |
end | |
end | |
===================================================== | |
this gives | |
===================================================== | |
goals GET /users/:id/goals(.:format) {:action=>"index", :controller=>"goals"} | |
POST /users/:id/goals(.:format) {:action=>"create", :controller=>"goals"} | |
new_goal GET /users/:id/goals/new(.:format) {:action=>"new", :controller=>"goals"} | |
edit_goal GET /users/:id/goals/:id/edit(.:format) {:action=>"edit", :controller=>"goals"} | |
goal GET /users/:id/goals/:id(.:format) {:action=>"show", :controller=>"goals"} | |
PUT /users/:id/goals/:id(.:format) {:action=>"update", :controller=>"goals"} | |
DELETE /users/:id/goals/:id(.:format) {:action=>"destroy", :controller=>"goals"} | |
==================================================== | |
How can I change the first :id to :user_id so i get e.g. params[:user_id] instead of just one :id in params? :) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment