Is it possible to imagine another parameter outside the form data in rails? My problem is that I process different forms for different classes and send them to the same creation method. I would like to send a class with a form (as a value not as a key in a hash). Something like type: parameter (actually doesn't work)
<%= form_for(@an_object, :url => { :controller => :a_controller, :action => :create }, :type => @an_object.class.to_s.underscore) do |f| %>
The message will look like this:
{"commit"=>"Create Class of an Object", "authenticity_token"=>"/iqu0A8/AocDT3HyjL5/+bKZiLkyr4FE71u/mc8Wx0Y=", "utf8"=>"รขล"", "class_of_an_object"=>{"name"=>"a name", "description"=>"a description"}}
and I would have "type" => "class_of_an_object" , but directly in the hash, not in the hash of "class_of_an_object".
bertolami
source share