I'm using a inherited controller for an abstracted class. I'm trying to avoid overriding actions within all of the descendant controllers. How could I find out the name of the key where the array of form values is living? For example:
The master class currently uses this to update rows
if @parent.update_attributes(params[:parent])
Every class that inherits from it has its own name that will not be recognized
<input type="text" value="" name="child[title]" id="child_title">
How can I dynamically detect the :name I need to use in the params[ ] for each form? I would settle for some form_for guidance for my partial that handles edit and new:
form_for @parent do |f|
I've tried what is below but I can't get it to do PUT. When I edit it makes a new row:
form_for @child, :as => :parent, :url => child_path do |f|