Answer the question
In order to leave comments, you need to log in
How in Rails to accept the content of an input where name='address[1]' ???
For example, there are fields:
<input type='text' name='address[1]' />
<input type='text' name='address[2]' />
Answer the question
In order to leave comments, you need to log in
you don't have to do that! It is necessary to accept all data through strong parameters
something like this:
the field must have the name name="model[address][]" value="1"
-----------------
But in answer to your question
pp params[:address]['1'] # => 'asdf'
# "address"=>{"1"=>"asdf"}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question