Reputation: 740
Building a project with Rails 3.1
I would like to provide a link in a parent model's show page that passes the parent model's id to a child object controller's create method.
I'm guessing this will require a custom route, but have no idea how to build it.
Is this possible? Or would I be breaking a Rails convention? I don't want to use a multiple model form if I can avoid it.
Thanks!
Upvotes: 1
Views: 273
Reputation: 26997
You can just pass them in as arbitrary values:
link_to my_path(:extra_attribute => value, :foo => 'bar')
Upvotes: 2