Hello all, I have created a migration add_details _to users ... ( city_id , profession ) and then migrated it.. when i use params[:user] to update the database by taking user inputs from forms in views, it is not updating the database for these city_id and profession... ( not changing from null ) if add validation for presence of city_id .. it is giving the error "City id cant be blank." even though i filled it... where as it is working fine with the fields i have added in create_users migration... do i have to change anything else when create new migration in AddDetailstoUsers migration .. other than using rake db:migrate .... Thanks., Sagar -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
use add_detail_to_users> >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
or if you ran the migration properly - maybe it''s a mass assignment issue? if you have attr_accessible in your model and you haven''t added these new attributes to be accessible then you would be getting these errors. On Apr 8, 3:50 am, sagar <sujitsagar1...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hello all, > > I have created a migration add_details _to users ... ( city_id , > profession ) > and then migrated it.. > > when i use params[:user] to update the database by taking user inputs > from forms in views, it is not updating the database for these city_id > and profession... ( not changing from null ) > if add validation for presence of city_id .. it is giving the error > "City id cant be blank." even though i filled it... > > where as it is working fine with the fields i have added in > create_users migration... > > do i have to change anything else when create new migration in > AddDetailstoUsers migration .. other than using rake db:migrate .... > > Thanks., > Sagar-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Thank you so much.. This solved my problem ... :) On Apr 9, 8:02 am, MissingHandle <gabe.sara...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> or if you ran the migration properly - maybe it''s a mass assignment > issue? > > if you have attr_accessible in your model and you haven''t added these > new attributes to be accessible then you would be getting these > errors. > > On Apr 8, 3:50 am, sagar <sujitsagar1...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > > > Hello all, > > > I have created a migration add_details _to users ... ( city_id , > > profession ) > > and then migrated it.. > > > when i use params[:user] to update the database by taking user inputs > > from forms in views, it is not updating the database for these city_id > > and profession... ( not changing from null ) > > if add validation for presence of city_id .. it is giving the error > > "City id cant be blank." even though i filled it... > > > where as it is working fine with the fields i have added in > > create_users migration... > > > do i have to change anything else when create new migration in > > AddDetailstoUsers migration .. other than using rake db:migrate .... > > > Thanks., > > Sagar-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.