in Rails the create method in a Controller by default receives an HTTP request with different values. By default new records are created like this:
@apo = Apo.new(params[:apo])
But how can i access single Values from this params hash?
I would like to create something like this:
@apo = Apo.new do |a|
a.name = $someVariable
a.value = $anotherVariable
a.quantity = -> here i want to have one value which is in params[:apo]
end
Do you understand what i´m looking for? Tried million possibilities but it just doesn´t work.
Alternatively, is it possible, to create a second params hash in the view, which only saves this one value?
P.S. i don´t want to use JavaScript for doing this...
Thanks a lot!