I am having a confounding issue and I hoping somebody can give me a
clue as to what is happening.
I have one field in my table which is not updating via the form. It
updates fine if I extract the information from the params and do it
manually in the controller. On this form the ebmedded form is also
not updating any of the child records but first I’d like to figure out
what is going on here.
Basically you have this User has_many :contact_methods.
The form looks like this.
- form_for (@user, :url => edit_profile_url) do |f|
= f.label :email
%br/
= f.text_field :email, :class => “text-input”
%br/
= f.label :name
%br/
= f.text_field :name, :class => “text-input”
%br/
= f.label :location
%br/
= f.text_field :location, :class => “text-input”
%br/
= f.label :skills_list , ‘My skills are (comma separated list)’
%br/
= f.text_field :skill_list, :label => ‘My skills are (comma
separated list)’ , :class => “text-input”
%br/
= f.label :bio
%br/
= f.text_field :bio, :label => ’ Brief personal summary’ , :class
=> “text-input”
%br/
= render ‘contact_methods’ , {:f => f}
=f.submit
Every field in here is updatable except the location field. For some
odd reason it won’t update the location field when you submit the
form.
If I do this in the controller it works fine.
@user.update_attributes(params[:user])
location = params[:user][:location]
@user.location = location if location
so why is only this one field not updating while everything else is?
Is “location” a special term?