Created
July 17, 2014 18:56
-
-
Save magicmarkker/925f603fa6ec5d8b29ac to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# routes.rb | |
resources :committees, as: :workrooms, path: :workrooms do | |
resources :meetings, concerns: :bookable | |
end | |
# Generates | |
# workroom_meeting_book GET /workrooms/:workroom_id/meetings/:meeting_id/books/:id( | |
polymorphic_path([@workroom, @meeting, @book]) | |
# But since @workroom is really a Committee model | |
# It's generating: committee_meeting_book_path :( |
Fixed it by changing the route to this:
resources :workrooms, as: :committees
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Lame, trying to refactor all of these
if/else
to get rid of some code smell