Ask A Question
You’re not receiving notifications from this thread.
How do I preselect a reference to a resource that is not a parent in the routes?
I have an app with a ContentCategory model that has_many :contents. In the ContentCategoriesController#show view there is a button for "New Content". This goes to the ContentsController#new view which has a select box for the content_category. Currently this defaults to the first category in the list instead of the desired behavior of defaulting to the ContentCategory of the page before. Is there a way to achieve this without nesting the resources in routes.rb?