Skip to content

Instantly share code, notes, and snippets.

@magicmarkker
Created July 17, 2014 18:56
Show Gist options
  • Save magicmarkker/925f603fa6ec5d8b29ac to your computer and use it in GitHub Desktop.
Save magicmarkker/925f603fa6ec5d8b29ac to your computer and use it in GitHub Desktop.
# 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 :(
@magicmarkker
Copy link
Author

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