Newbie to rails and on many online tutorials I see this example
<div class="field">
<%= f.label :first_name %><br />
<%= f.text_field :first_name %>
</div>
<div class="field">
<%= f.label :last_name %><br />
<%= f.text_field :last_name %>
</div>
which stores like this
"first_name"=>"foo", "last_name"=>"bar"
Is there a way use text_field or another form attribute to store two inputs in an array, so it would end up something like:
"name"=>["foo", "bar"]
This is not the preferred way, but curious to see how it would be done
Update
In your example you are passing @user.first_name and .last_name as the value. I was thinking more something more like this:
<div class="field">
<%= f.label "First Name" %><br />
<%= f.text_field :name %>
</div>
<div class="field">
<%= f.label "Last Name" %><br />
<%= f.text_field :name %>
</div>
where there is no @user.first_name
but @user.name[0]