Skip to content

Instantly share code, notes, and snippets.

@jlebrech
Last active December 13, 2015 19:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jlebrech/4960650 to your computer and use it in GitHub Desktop.
Save jlebrech/4960650 to your computer and use it in GitHub Desktop.
Nested resource with custom path
..
form_for [current_user,@thing]
..
# this creates the path
# /user/bob/things to post to
# but I would like the path
# /bob/things
..
resources :users do
resources :things
end
...
match "/:username" => "users#show", :as => :user_profile, :username => /(.*)/
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment