Last active
December 13, 2015 19:08
-
-
Save jlebrech/4960650 to your computer and use it in GitHub Desktop.
Nested resource with custom path
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
.. | |
form_for [current_user,@thing] | |
.. | |
# this creates the path | |
# /user/bob/things to post to | |
# but I would like the path | |
# /bob/things | |
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 | |
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