Hello All, I am stuck in nested attributes:- here is my code :- User.rb :- has_one :address accepts_nested_attributes_for :address Address.rb :- belongs_to :user _form.html.erb:- <%= simple_form_for @user ,:validate => true do |f| %> <%= f.fields_for :address do |d| %> <%= d.input :first_name %> <%= d.input :last_name %> <% end %> <%= f.input :email %> <% end %> in user_controller.rb:- In new as well as create method I tried with:- @user = User.new @user.build_profile But still I am getting the error as :- Can''t mass-assign protected attributes: address_attributes Any Suggestions ?? Thanks.... -- 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 To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/dd447A7hSYwJ. For more options, visit https://groups.google.com/groups/opt_out.
add *attr_accessible :address_attributes* in your model. Only the fields that you specify via attr_accessible, are open to mass assignment. Unni On Wed, Nov 21, 2012 at 10:02 AM, Avi <aavinash.behera-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hello All, > > I am stuck in nested attributes:- > here is my code :- > > User.rb :- > has_one :address > accepts_nested_attributes_for :address > > Address.rb :- > > belongs_to :user > > _form.html.erb:- > > <%= simple_form_for @user ,:validate => true do |f| %> > <%= f.fields_for :address do |d| %> > <%= d.input :first_name %> > <%= d.input :last_name %> > <% end %> > <%= f.input :email %> > <% end %> > > in user_controller.rb:- > In new as well as create method I tried with:- > @user = User.new > @user.build_profile > > But still I am getting the error as :- > > Can''t mass-assign protected attributes: address_attributes > > Any Suggestions ?? > > Thanks.... > > > -- > 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 > To view this discussion on the web visit > https://groups.google.com/d/msg/rubyonrails-talk/-/dd447A7hSYwJ. > For more options, visit https://groups.google.com/groups/opt_out. > > >-- Unni -- 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 https://groups.google.com/groups/opt_out.
I didn''t get this :- *attr_accessible :address_attributes* * * Why we need to define this in user.rb? We already have has_one relation. Will it not be accessing those attributes in address model automatically? On Wed, Nov 21, 2012 at 10:11 AM, Unni <unni.tallman-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> add > > *attr_accessible :address_attributes* > > in your model. > > Only the fields that you specify via attr_accessible, are open to mass > assignment. > > Unni > > On Wed, Nov 21, 2012 at 10:02 AM, Avi <aavinash.behera-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> Hello All, >> >> I am stuck in nested attributes:- >> here is my code :- >> >> User.rb :- >> has_one :address >> accepts_nested_attributes_for :address >> >> Address.rb :- >> >> belongs_to :user >> >> _form.html.erb:- >> >> <%= simple_form_for @user ,:validate => true do |f| %> >> <%= f.fields_for :address do |d| %> >> <%= d.input :first_name %> >> <%= d.input :last_name %> >> <% end %> >> <%= f.input :email %> >> <% end %> >> >> in user_controller.rb:- >> In new as well as create method I tried with:- >> @user = User.new >> @user.build_profile >> >> But still I am getting the error as :- >> >> >> Can''t mass-assign protected attributes: address_attributes >> >> Any Suggestions ?? >> >> >> Thanks.... >> >> >> -- >> 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 >> To view this discussion on the web visit >> https://groups.google.com/d/msg/rubyonrails-talk/-/dd447A7hSYwJ. >> For more options, visit https://groups.google.com/groups/opt_out. >> >> >> > > > > -- > Unni > > -- > 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 https://groups.google.com/groups/opt_out. > > >-- 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 https://groups.google.com/groups/opt_out.
On Wed, Nov 21, 2012 at 12:56 PM, avinash behera <aavinash.behera-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>wrote:> I didn''t get this :- > *attr_accessible :address_attributes* > * > * > Why we need to define this in user.rb? > We already have has_one relation. Will it not be accessing those > attributes in address model automatically? >fields_for uses <association>_attributes as the name of the fields when you are using accepts_nested_attributes_for :association so you need to define this in attr_accessible> > > On Wed, Nov 21, 2012 at 10:11 AM, Unni <unni.tallman-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> add >> >> *attr_accessible :address_attributes* >> >> in your model. >> >> Only the fields that you specify via attr_accessible, are open to mass >> assignment. >> >> Unni >> >> On Wed, Nov 21, 2012 at 10:02 AM, Avi <aavinash.behera-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> >>> Hello All, >>> >>> I am stuck in nested attributes:- >>> here is my code :- >>> >>> User.rb :- >>> has_one :address >>> accepts_nested_attributes_for :address >>> >>> Address.rb :- >>> >>> belongs_to :user >>> >>> _form.html.erb:- >>> >>> <%= simple_form_for @user ,:validate => true do |f| %> >>> <%= f.fields_for :address do |d| %> >>> <%= d.input :first_name %> >>> <%= d.input :last_name %> >>> <% end %> >>> <%= f.input :email %> >>> <% end %> >>> >>> in user_controller.rb:- >>> In new as well as create method I tried with:- >>> @user = User.new >>> @user.build_profile >>> >>> But still I am getting the error as :- >>> >>> Can''t mass-assign protected attributes: address_attributes >>> >>> Any Suggestions ?? >>> >>> Thanks.... >>> >>> >>> -- >>> 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 >>> To view this discussion on the web visit >>> https://groups.google.com/d/msg/rubyonrails-talk/-/dd447A7hSYwJ. >>> For more options, visit https://groups.google.com/groups/opt_out. >>> >>> >>> >> >> >> >> -- >> Unni >> >> -- >> 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 https://groups.google.com/groups/opt_out. >> >> >> > > > -- > 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 https://groups.google.com/groups/opt_out. > > >-- ------------------------------------------------------------- visit my blog at http://jimlabs.heroku.com -- 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 https://groups.google.com/groups/opt_out.
http://stackoverflow.com/a/3283404/1731232 http://api.rubyonrails.org/classes/ActiveModel/MassAssignmentSecurity/ClassMethods.html#method-i-attr_accessible On Wed, Nov 21, 2012 at 10:31 AM, Jim Ruther Nill <jvnill-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > > On Wed, Nov 21, 2012 at 12:56 PM, avinash behera < > aavinash.behera-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> I didn''t get this :- >> *attr_accessible :address_attributes* >> * >> * >> Why we need to define this in user.rb? >> We already have has_one relation. Will it not be accessing those >> attributes in address model automatically? >> > > fields_for uses <association>_attributes as the name of the fields when > you are using > accepts_nested_attributes_for :association so you need to define this in > attr_accessible > > >> >> >> On Wed, Nov 21, 2012 at 10:11 AM, Unni <unni.tallman-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> >>> add >>> >>> *attr_accessible :address_attributes* >>> >>> in your model. >>> >>> Only the fields that you specify via attr_accessible, are open to mass >>> assignment. >>> >>> Unni >>> >>> On Wed, Nov 21, 2012 at 10:02 AM, Avi <aavinash.behera-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >>> >>>> Hello All, >>>> >>>> I am stuck in nested attributes:- >>>> here is my code :- >>>> >>>> User.rb :- >>>> has_one :address >>>> accepts_nested_attributes_for :address >>>> >>>> Address.rb :- >>>> >>>> belongs_to :user >>>> >>>> _form.html.erb:- >>>> >>>> <%= simple_form_for @user ,:validate => true do |f| %> >>>> <%= f.fields_for :address do |d| %> >>>> <%= d.input :first_name %> >>>> <%= d.input :last_name %> >>>> <% end %> >>>> <%= f.input :email %> >>>> <% end %> >>>> >>>> in user_controller.rb:- >>>> In new as well as create method I tried with:- >>>> @user = User.new >>>> @user.build_profile >>>> >>>> But still I am getting the error as :- >>>> >>>> Can''t mass-assign protected attributes: address_attributes >>>> >>>> Any Suggestions ?? >>>> >>>> Thanks.... >>>> >>>> >>>> -- >>>> 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 >>>> To view this discussion on the web visit >>>> https://groups.google.com/d/msg/rubyonrails-talk/-/dd447A7hSYwJ. >>>> For more options, visit https://groups.google.com/groups/opt_out. >>>> >>>> >>>> >>> >>> >>> >>> -- >>> Unni >>> >>> -- >>> 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 https://groups.google.com/groups/opt_out. >>> >>> >>> >> >> >> -- >> 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 https://groups.google.com/groups/opt_out. >> >> >> > > > > -- > ------------------------------------------------------------- > visit my blog at http://jimlabs.heroku.com > > -- > 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 https://groups.google.com/groups/opt_out. > > >-- Unni -- 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 https://groups.google.com/groups/opt_out.
http://currentricity.wordpress.com/2011/09/04/the-definitive-guide-to-accept s_nested_attributes_for-a-model-in-rails-3/ From: Unni <unni.tallman-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> Reply-To: <rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> Date: Wednesday, 21 November 2012 10:44 AM To: <rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> Subject: Re: [Rails] Nested Attributes in Rails 3 http://stackoverflow.com/a/3283404/1731232 http://api.rubyonrails.org/classes/ActiveModel/MassAssignmentSecurity/ClassM ethods.html#method-i-attr_accessible On Wed, Nov 21, 2012 at 10:31 AM, Jim Ruther Nill <jvnill-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > > On Wed, Nov 21, 2012 at 12:56 PM, avinash behera <aavinash.behera-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: >> I didn''t get this :- >> attr_accessible :address_attributes >> >> Why we need to define this in user.rb? >> We already have has_one relation. Will it not be accessing those attributes >> in address model automatically? > > fields_for uses <association>_attributes as the name of the fields when you > are using > accepts_nested_attributes_for :association so you need to define this in > attr_accessible > >> >> >> On Wed, Nov 21, 2012 at 10:11 AM, Unni <unni.tallman-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >>> add >>> >>> attr_accessible :address_attributes >>> >>> in your model. >>> >>> Only the fields that you specify via attr_accessible, are open to mass >>> assignment. >>> >>> Unni >>> >>> On Wed, Nov 21, 2012 at 10:02 AM, Avi <aavinash.behera-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >>>> Hello All, >>>> >>>> I am stuck in nested attributes:- >>>> here is my code :- >>>> >>>> User.rb :- >>>> has_one :address >>>> accepts_nested_attributes_for :address >>>> >>>> Address.rb :- >>>> >>>> belongs_to :user >>>> >>>> _form.html.erb:- >>>> >>>> <%= simple_form_for @user ,:validate => true do |f| %> >>>> <%= f.fields_for :address do |d| %> >>>> <%= d.input :first_name %> >>>> <%= d.input :last_name %> >>>> <% end %> >>>> <%= f.input :email %> >>>> <% end %> >>>> >>>> in user_controller.rb:- >>>> In new as well as create method I tried with:- >>>> @user = User.new >>>> @user.build_profile >>>> >>>> But still I am getting the error as :- >>>> Can''t mass-assign protected attributes: address_attributes >>>> Any Suggestions ?? >>>> Thanks.... >>>> >>>> >>>> -- >>>> 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org >>>> <mailto:rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> . >>>> To view this discussion on the web visit >>>> https://groups.google.com/d/msg/rubyonrails-talk/-/dd447A7hSYwJ. >>>> For more options, visit https://groups.google.com/groups/opt_out. >>>> >>>> >>> >>> >>> >>> -- >>> Unni >>> >>> -- >>> 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org >>> <mailto:rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> . >>> For more options, visit https://groups.google.com/groups/opt_out. >>> >>> >> >> >> -- >> 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org >> <mailto:rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> . >> For more options, visit https://groups.google.com/groups/opt_out. >> >> > > > > -- > ------------------------------------------------------------- > visit my blog at http://jimlabs.heroku.com > -- > 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > <mailto:rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> . > For more options, visit https://groups.google.com/groups/opt_out. > >-- Unni -- 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 https://groups.google.com/groups/opt_out. -- 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 https://groups.google.com/groups/opt_out.
I tried with that. But somewhere validations are failing. I had dropped my db. Trying to create a user. But in console it says: User already exists. Not sure. In controller I have mentioned as @user.build_profile. Is it fine? & in erb file, I am using simple_form_for. So can we use fields_for there? On Wed, Nov 21, 2012 at 10:44 AM, Unni <unni.tallman-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> http://stackoverflow.com/a/3283404/1731232 > > > http://api.rubyonrails.org/classes/ActiveModel/MassAssignmentSecurity/ClassMethods.html#method-i-attr_accessible > > > On Wed, Nov 21, 2012 at 10:31 AM, Jim Ruther Nill <jvnill-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>wrote: > >> >> >> >> On Wed, Nov 21, 2012 at 12:56 PM, avinash behera < >> aavinash.behera-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> >>> I didn''t get this :- >>> *attr_accessible :address_attributes* >>> * >>> * >>> Why we need to define this in user.rb? >>> We already have has_one relation. Will it not be accessing those >>> attributes in address model automatically? >>> >> >> fields_for uses <association>_attributes as the name of the fields when >> you are using >> accepts_nested_attributes_for :association so you need to define this in >> attr_accessible >> >> >>> >>> >>> On Wed, Nov 21, 2012 at 10:11 AM, Unni <unni.tallman-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >>> >>>> add >>>> >>>> *attr_accessible :address_attributes* >>>> >>>> in your model. >>>> >>>> Only the fields that you specify via attr_accessible, are open to mass >>>> assignment. >>>> >>>> Unni >>>> >>>> On Wed, Nov 21, 2012 at 10:02 AM, Avi <aavinash.behera-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>wrote: >>>> >>>>> Hello All, >>>>> >>>>> I am stuck in nested attributes:- >>>>> here is my code :- >>>>> >>>>> User.rb :- >>>>> has_one :address >>>>> accepts_nested_attributes_for :address >>>>> >>>>> Address.rb :- >>>>> >>>>> belongs_to :user >>>>> >>>>> _form.html.erb:- >>>>> >>>>> <%= simple_form_for @user ,:validate => true do |f| %> >>>>> <%= f.fields_for :address do |d| %> >>>>> <%= d.input :first_name %> >>>>> <%= d.input :last_name %> >>>>> <% end %> >>>>> <%= f.input :email %> >>>>> <% end %> >>>>> >>>>> in user_controller.rb:- >>>>> In new as well as create method I tried with:- >>>>> @user = User.new >>>>> @user.build_profile >>>>> >>>>> But still I am getting the error as :- >>>>> >>>>> >>>>> Can''t mass-assign protected attributes: address_attributes >>>>> >>>>> Any Suggestions ?? >>>>> >>>>> >>>>> Thanks.... >>>>> >>>>> >>>>> -- >>>>> 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org >>>>> . >>>>> To unsubscribe from this group, send email to >>>>> rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>>>> To view this discussion on the web visit >>>>> https://groups.google.com/d/msg/rubyonrails-talk/-/dd447A7hSYwJ. >>>>> For more options, visit https://groups.google.com/groups/opt_out. >>>>> >>>>> >>>>> >>>> >>>> >>>> >>>> -- >>>> Unni >>>> >>>> -- >>>> 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 https://groups.google.com/groups/opt_out. >>>> >>>> >>>> >>> >>> >>> -- >>> 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 https://groups.google.com/groups/opt_out. >>> >>> >>> >> >> >> >> -- >> ------------------------------------------------------------- >> visit my blog at http://jimlabs.heroku.com >> >> -- >> 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 https://groups.google.com/groups/opt_out. >> >> >> > > > > -- > Unni > > -- > 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 https://groups.google.com/groups/opt_out. > > >-- 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 https://groups.google.com/groups/opt_out.
*@user = User.new* *@user.build_profile* Is that all what you have in the controller in create action? *@user = User.new(params[:user]) * is what one would expect. On Wed, Nov 21, 2012 at 11:17 AM, avinash behera <aavinash.behera-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>wrote:> I tried with that. But somewhere validations are failing. I had dropped my > db. Trying to create a user. But in console it says: > User already exists. > Not sure. > In controller I have mentioned as @user.build_profile. Is it fine? > & in erb file, I am using simple_form_for. > So can we use fields_for there? > > > On Wed, Nov 21, 2012 at 10:44 AM, Unni <unni.tallman-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> http://stackoverflow.com/a/3283404/1731232 >> >> >> http://api.rubyonrails.org/classes/ActiveModel/MassAssignmentSecurity/ClassMethods.html#method-i-attr_accessible >> >> >> On Wed, Nov 21, 2012 at 10:31 AM, Jim Ruther Nill <jvnill-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>wrote: >> >>> >>> >>> >>> On Wed, Nov 21, 2012 at 12:56 PM, avinash behera < >>> aavinash.behera-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >>> >>>> I didn''t get this :- >>>> *attr_accessible :address_attributes* >>>> * >>>> * >>>> Why we need to define this in user.rb? >>>> We already have has_one relation. Will it not be accessing those >>>> attributes in address model automatically? >>>> >>> >>> fields_for uses <association>_attributes as the name of the fields when >>> you are using >>> accepts_nested_attributes_for :association so you need to define this in >>> attr_accessible >>> >>> >>>> >>>> >>>> On Wed, Nov 21, 2012 at 10:11 AM, Unni <unni.tallman-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >>>> >>>>> add >>>>> >>>>> *attr_accessible :address_attributes* >>>>> >>>>> in your model. >>>>> >>>>> Only the fields that you specify via attr_accessible, are open to mass >>>>> assignment. >>>>> >>>>> Unni >>>>> >>>>> On Wed, Nov 21, 2012 at 10:02 AM, Avi <aavinash.behera-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>wrote: >>>>> >>>>>> Hello All, >>>>>> >>>>>> I am stuck in nested attributes:- >>>>>> here is my code :- >>>>>> >>>>>> User.rb :- >>>>>> has_one :address >>>>>> accepts_nested_attributes_for :address >>>>>> >>>>>> Address.rb :- >>>>>> >>>>>> belongs_to :user >>>>>> >>>>>> _form.html.erb:- >>>>>> >>>>>> <%= simple_form_for @user ,:validate => true do |f| %> >>>>>> <%= f.fields_for :address do |d| %> >>>>>> <%= d.input :first_name %> >>>>>> <%= d.input :last_name %> >>>>>> <% end %> >>>>>> <%= f.input :email %> >>>>>> <% end %> >>>>>> >>>>>> in user_controller.rb:- >>>>>> In new as well as create method I tried with:- >>>>>> @user = User.new >>>>>> @user.build_profile >>>>>> >>>>>> But still I am getting the error as :- >>>>>> >>>>>> Can''t mass-assign protected attributes: address_attributes >>>>>> >>>>>> Any Suggestions ?? >>>>>> >>>>>> Thanks.... >>>>>> >>>>>> >>>>>> -- >>>>>> 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 >>>>>> To view this discussion on the web visit >>>>>> https://groups.google.com/d/msg/rubyonrails-talk/-/dd447A7hSYwJ. >>>>>> For more options, visit https://groups.google.com/groups/opt_out. >>>>>> >>>>>> >>>>>> >>>>> >>>>> >>>>> >>>>> -- >>>>> Unni >>>>> >>>>> -- >>>>> 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org >>>>> . >>>>> To unsubscribe from this group, send email to >>>>> rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>>>> For more options, visit https://groups.google.com/groups/opt_out. >>>>> >>>>> >>>>> >>>> >>>> >>>> -- >>>> 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 https://groups.google.com/groups/opt_out. >>>> >>>> >>>> >>> >>> >>> >>> -- >>> ------------------------------------------------------------- >>> visit my blog at http://jimlabs.heroku.com >>> >>> -- >>> 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 https://groups.google.com/groups/opt_out. >>> >>> >>> >> >> >> >> -- >> Unni >> >> -- >> 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 https://groups.google.com/groups/opt_out. >> >> >> > > > > > -- > 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 https://groups.google.com/groups/opt_out. > > >-- Unni -- 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 https://groups.google.com/groups/opt_out.
In new :- @user = User.new @user.build_address # here is it required while building the page ? create :- @user = User.new(params[:user]) @user.save If I use build here, I am not getting those attributes present in address model in UI. Sorry I have communicated wrong. This is the controller On Wed, Nov 21, 2012 at 11:36 AM, Unni <unni.tallman-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> *@user = User.new* > *@user.build_profile* > > Is that all what you have in the controller in create action? > > *@user = User.new(params[:user]) * > > is what one would expect. > > On Wed, Nov 21, 2012 at 11:17 AM, avinash behera < > aavinash.behera-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> I tried with that. But somewhere validations are failing. I had dropped >> my db. Trying to create a user. But in console it says: >> User already exists. >> Not sure. >> In controller I have mentioned as @user.build_profile. Is it fine? >> & in erb file, I am using simple_form_for. >> So can we use fields_for there? >> >> >> On Wed, Nov 21, 2012 at 10:44 AM, Unni <unni.tallman-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> >>> http://stackoverflow.com/a/3283404/1731232 >>> >>> >>> http://api.rubyonrails.org/classes/ActiveModel/MassAssignmentSecurity/ClassMethods.html#method-i-attr_accessible >>> >>> >>> On Wed, Nov 21, 2012 at 10:31 AM, Jim Ruther Nill <jvnill-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>wrote: >>> >>>> >>>> >>>> >>>> On Wed, Nov 21, 2012 at 12:56 PM, avinash behera < >>>> aavinash.behera-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >>>> >>>>> I didn''t get this :- >>>>> *attr_accessible :address_attributes* >>>>> * >>>>> * >>>>> Why we need to define this in user.rb? >>>>> We already have has_one relation. Will it not be accessing those >>>>> attributes in address model automatically? >>>>> >>>> >>>> fields_for uses <association>_attributes as the name of the fields when >>>> you are using >>>> accepts_nested_attributes_for :association so you need to define this >>>> in attr_accessible >>>> >>>> >>>>> >>>>> >>>>> On Wed, Nov 21, 2012 at 10:11 AM, Unni <unni.tallman-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >>>>> >>>>>> add >>>>>> >>>>>> *attr_accessible :address_attributes* >>>>>> >>>>>> in your model. >>>>>> >>>>>> Only the fields that you specify via attr_accessible, are open to >>>>>> mass assignment. >>>>>> >>>>>> Unni >>>>>> >>>>>> On Wed, Nov 21, 2012 at 10:02 AM, Avi <aavinash.behera-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>wrote: >>>>>> >>>>>>> Hello All, >>>>>>> >>>>>>> I am stuck in nested attributes:- >>>>>>> here is my code :- >>>>>>> >>>>>>> User.rb :- >>>>>>> has_one :address >>>>>>> accepts_nested_attributes_for :address >>>>>>> >>>>>>> Address.rb :- >>>>>>> >>>>>>> belongs_to :user >>>>>>> >>>>>>> _form.html.erb:- >>>>>>> >>>>>>> <%= simple_form_for @user ,:validate => true do |f| %> >>>>>>> <%= f.fields_for :address do |d| %> >>>>>>> <%= d.input :first_name %> >>>>>>> <%= d.input :last_name %> >>>>>>> <% end %> >>>>>>> <%= f.input :email %> >>>>>>> <% end %> >>>>>>> >>>>>>> in user_controller.rb:- >>>>>>> In new as well as create method I tried with:- >>>>>>> @user = User.new >>>>>>> @user.build_profile >>>>>>> >>>>>>> But still I am getting the error as :- >>>>>>> >>>>>>> >>>>>>> Can''t mass-assign protected attributes: address_attributes >>>>>>> >>>>>>> Any Suggestions ?? >>>>>>> >>>>>>> >>>>>>> Thanks.... >>>>>>> >>>>>>> >>>>>>> -- >>>>>>> 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 >>>>>>> To view this discussion on the web visit >>>>>>> https://groups.google.com/d/msg/rubyonrails-talk/-/dd447A7hSYwJ. >>>>>>> For more options, visit https://groups.google.com/groups/opt_out. >>>>>>> >>>>>>> >>>>>>> >>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> Unni >>>>>> >>>>>> -- >>>>>> 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 https://groups.google.com/groups/opt_out. >>>>>> >>>>>> >>>>>> >>>>> >>>>> >>>>> -- >>>>> 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org >>>>> . >>>>> To unsubscribe from this group, send email to >>>>> rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>>>> For more options, visit https://groups.google.com/groups/opt_out. >>>>> >>>>> >>>>> >>>> >>>> >>>> >>>> -- >>>> ------------------------------------------------------------- >>>> visit my blog at http://jimlabs.heroku.com >>>> >>>> -- >>>> 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 https://groups.google.com/groups/opt_out. >>>> >>>> >>>> >>> >>> >>> >>> -- >>> Unni >>> >>> -- >>> 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 https://groups.google.com/groups/opt_out. >>> >>> >>> >> >> >> >> >> -- >> 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 https://groups.google.com/groups/opt_out. >> >> >> > > > > -- > Unni > > -- > 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 https://groups.google.com/groups/opt_out. > > >-- 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 https://groups.google.com/groups/opt_out.
Its working now. Its my fault. I forgot to remove an attribute''s validation which I moved from User model to Address model. There validation was failing. Thanks for helping me out... On Wed, Nov 21, 2012 at 11:46 AM, avinash behera <aavinash.behera-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>wrote:> In new :- > > @user = User.new > @user.build_address # here is it required while building the page ? > > create :- > > @user = User.new(params[:user]) > @user.save > If I use build here, I am not getting those attributes present in address > model in UI. > > Sorry I have communicated wrong. This is the controller > > > On Wed, Nov 21, 2012 at 11:36 AM, Unni <unni.tallman-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> *@user = User.new* >> *@user.build_profile* >> >> Is that all what you have in the controller in create action? >> >> *@user = User.new(params[:user]) * >> >> is what one would expect. >> >> On Wed, Nov 21, 2012 at 11:17 AM, avinash behera < >> aavinash.behera-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> >>> I tried with that. But somewhere validations are failing. I had dropped >>> my db. Trying to create a user. But in console it says: >>> User already exists. >>> Not sure. >>> In controller I have mentioned as @user.build_profile. Is it fine? >>> & in erb file, I am using simple_form_for. >>> So can we use fields_for there? >>> >>> >>> On Wed, Nov 21, 2012 at 10:44 AM, Unni <unni.tallman-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >>> >>>> http://stackoverflow.com/a/3283404/1731232 >>>> >>>> >>>> http://api.rubyonrails.org/classes/ActiveModel/MassAssignmentSecurity/ClassMethods.html#method-i-attr_accessible >>>> >>>> >>>> On Wed, Nov 21, 2012 at 10:31 AM, Jim Ruther Nill <jvnill-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>wrote: >>>> >>>>> >>>>> >>>>> >>>>> On Wed, Nov 21, 2012 at 12:56 PM, avinash behera < >>>>> aavinash.behera-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >>>>> >>>>>> I didn''t get this :- >>>>>> *attr_accessible :address_attributes* >>>>>> * >>>>>> * >>>>>> Why we need to define this in user.rb? >>>>>> We already have has_one relation. Will it not be accessing those >>>>>> attributes in address model automatically? >>>>>> >>>>> >>>>> fields_for uses <association>_attributes as the name of the fields >>>>> when you are using >>>>> accepts_nested_attributes_for :association so you need to define this >>>>> in attr_accessible >>>>> >>>>> >>>>>> >>>>>> >>>>>> On Wed, Nov 21, 2012 at 10:11 AM, Unni <unni.tallman-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>wrote: >>>>>> >>>>>>> add >>>>>>> >>>>>>> *attr_accessible :address_attributes* >>>>>>> >>>>>>> in your model. >>>>>>> >>>>>>> Only the fields that you specify via attr_accessible, are open to >>>>>>> mass assignment. >>>>>>> >>>>>>> Unni >>>>>>> >>>>>>> On Wed, Nov 21, 2012 at 10:02 AM, Avi <aavinash.behera-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>wrote: >>>>>>> >>>>>>>> Hello All, >>>>>>>> >>>>>>>> I am stuck in nested attributes:- >>>>>>>> here is my code :- >>>>>>>> >>>>>>>> User.rb :- >>>>>>>> has_one :address >>>>>>>> accepts_nested_attributes_for :address >>>>>>>> >>>>>>>> Address.rb :- >>>>>>>> >>>>>>>> belongs_to :user >>>>>>>> >>>>>>>> _form.html.erb:- >>>>>>>> >>>>>>>> <%= simple_form_for @user ,:validate => true do |f| %> >>>>>>>> <%= f.fields_for :address do |d| %> >>>>>>>> <%= d.input :first_name %> >>>>>>>> <%= d.input :last_name %> >>>>>>>> <% end %> >>>>>>>> <%= f.input :email %> >>>>>>>> <% end %> >>>>>>>> >>>>>>>> in user_controller.rb:- >>>>>>>> In new as well as create method I tried with:- >>>>>>>> @user = User.new >>>>>>>> @user.build_profile >>>>>>>> >>>>>>>> But still I am getting the error as :- >>>>>>>> >>>>>>>> >>>>>>>> Can''t mass-assign protected attributes: address_attributes >>>>>>>> >>>>>>>> Any Suggestions ?? >>>>>>>> >>>>>>>> >>>>>>>> Thanks.... >>>>>>>> >>>>>>>> >>>>>>>> -- >>>>>>>> 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 >>>>>>>> To view this discussion on the web visit >>>>>>>> https://groups.google.com/d/msg/rubyonrails-talk/-/dd447A7hSYwJ. >>>>>>>> For more options, visit https://groups.google.com/groups/opt_out. >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> -- >>>>>>> Unni >>>>>>> >>>>>>> -- >>>>>>> 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 https://groups.google.com/groups/opt_out. >>>>>>> >>>>>>> >>>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> 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 https://groups.google.com/groups/opt_out. >>>>>> >>>>>> >>>>>> >>>>> >>>>> >>>>> >>>>> -- >>>>> ------------------------------------------------------------- >>>>> visit my blog at http://jimlabs.heroku.com >>>>> >>>>> -- >>>>> 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org >>>>> . >>>>> To unsubscribe from this group, send email to >>>>> rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>>>> For more options, visit https://groups.google.com/groups/opt_out. >>>>> >>>>> >>>>> >>>> >>>> >>>> >>>> -- >>>> Unni >>>> >>>> -- >>>> 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 https://groups.google.com/groups/opt_out. >>>> >>>> >>>> >>> >>> >>> >>> >>> -- >>> 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 https://groups.google.com/groups/opt_out. >>> >>> >>> >> >> >> >> -- >> Unni >> >> -- >> 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 https://groups.google.com/groups/opt_out. >> >> >> > > > >-- 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 https://groups.google.com/groups/opt_out.
Cheers ! On Wed, Nov 21, 2012 at 11:55 AM, avinash behera <aavinash.behera-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>wrote:> Its working now. Its my fault. > I forgot to remove an attribute''s validation which I moved from User model > to Address model. There validation was failing. > Thanks for helping me out... > > > On Wed, Nov 21, 2012 at 11:46 AM, avinash behera < > aavinash.behera-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> In new :- >> >> @user = User.new >> @user.build_address # here is it required while building the page ? >> >> create :- >> >> @user = User.new(params[:user]) >> @user.save >> If I use build here, I am not getting those attributes present in address >> model in UI. >> >> Sorry I have communicated wrong. This is the controller >> >> >> On Wed, Nov 21, 2012 at 11:36 AM, Unni <unni.tallman-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> >>> *@user = User.new* >>> *@user.build_profile* >>> >>> Is that all what you have in the controller in create action? >>> >>> *@user = User.new(params[:user]) * >>> >>> is what one would expect. >>> >>> On Wed, Nov 21, 2012 at 11:17 AM, avinash behera < >>> aavinash.behera-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >>> >>>> I tried with that. But somewhere validations are failing. I had dropped >>>> my db. Trying to create a user. But in console it says: >>>> User already exists. >>>> Not sure. >>>> In controller I have mentioned as @user.build_profile. Is it fine? >>>> & in erb file, I am using simple_form_for. >>>> So can we use fields_for there? >>>> >>>> >>>> On Wed, Nov 21, 2012 at 10:44 AM, Unni <unni.tallman-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >>>> >>>>> http://stackoverflow.com/a/3283404/1731232 >>>>> >>>>> >>>>> http://api.rubyonrails.org/classes/ActiveModel/MassAssignmentSecurity/ClassMethods.html#method-i-attr_accessible >>>>> >>>>> >>>>> On Wed, Nov 21, 2012 at 10:31 AM, Jim Ruther Nill <jvnill-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>wrote: >>>>> >>>>>> >>>>>> >>>>>> >>>>>> On Wed, Nov 21, 2012 at 12:56 PM, avinash behera < >>>>>> aavinash.behera-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >>>>>> >>>>>>> I didn''t get this :- >>>>>>> *attr_accessible :address_attributes* >>>>>>> * >>>>>>> * >>>>>>> Why we need to define this in user.rb? >>>>>>> We already have has_one relation. Will it not be accessing those >>>>>>> attributes in address model automatically? >>>>>>> >>>>>> >>>>>> fields_for uses <association>_attributes as the name of the fields >>>>>> when you are using >>>>>> accepts_nested_attributes_for :association so you need to define this >>>>>> in attr_accessible >>>>>> >>>>>> >>>>>>> >>>>>>> >>>>>>> On Wed, Nov 21, 2012 at 10:11 AM, Unni <unni.tallman-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>wrote: >>>>>>> >>>>>>>> add >>>>>>>> >>>>>>>> *attr_accessible :address_attributes* >>>>>>>> >>>>>>>> in your model. >>>>>>>> >>>>>>>> Only the fields that you specify via attr_accessible, are open to >>>>>>>> mass assignment. >>>>>>>> >>>>>>>> Unni >>>>>>>> >>>>>>>> On Wed, Nov 21, 2012 at 10:02 AM, Avi <aavinash.behera-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>wrote: >>>>>>>> >>>>>>>>> Hello All, >>>>>>>>> >>>>>>>>> I am stuck in nested attributes:- >>>>>>>>> here is my code :- >>>>>>>>> >>>>>>>>> User.rb :- >>>>>>>>> has_one :address >>>>>>>>> accepts_nested_attributes_for :address >>>>>>>>> >>>>>>>>> Address.rb :- >>>>>>>>> >>>>>>>>> belongs_to :user >>>>>>>>> >>>>>>>>> _form.html.erb:- >>>>>>>>> >>>>>>>>> <%= simple_form_for @user ,:validate => true do |f| %> >>>>>>>>> <%= f.fields_for :address do |d| %> >>>>>>>>> <%= d.input :first_name %> >>>>>>>>> <%= d.input :last_name %> >>>>>>>>> <% end %> >>>>>>>>> <%= f.input :email %> >>>>>>>>> <% end %> >>>>>>>>> >>>>>>>>> in user_controller.rb:- >>>>>>>>> In new as well as create method I tried with:- >>>>>>>>> @user = User.new >>>>>>>>> @user.build_profile >>>>>>>>> >>>>>>>>> But still I am getting the error as :- >>>>>>>>> >>>>>>>>> Can''t mass-assign protected attributes: address_attributes >>>>>>>>> >>>>>>>>> Any Suggestions ?? >>>>>>>>> >>>>>>>>> Thanks.... >>>>>>>>> >>>>>>>>> >>>>>>>>> -- >>>>>>>>> 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 >>>>>>>>> To view this discussion on the web visit >>>>>>>>> https://groups.google.com/d/msg/rubyonrails-talk/-/dd447A7hSYwJ. >>>>>>>>> For more options, visit https://groups.google.com/groups/opt_out. >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> -- >>>>>>>> Unni >>>>>>>> >>>>>>>> -- >>>>>>>> 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 https://groups.google.com/groups/opt_out. >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>> >>>>>>> >>>>>>> -- >>>>>>> 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 https://groups.google.com/groups/opt_out. >>>>>>> >>>>>>> >>>>>>> >>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> ------------------------------------------------------------- >>>>>> visit my blog at http://jimlabs.heroku.com >>>>>> >>>>>> -- >>>>>> 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 https://groups.google.com/groups/opt_out. >>>>>> >>>>>> >>>>>> >>>>> >>>>> >>>>> >>>>> -- >>>>> Unni >>>>> >>>>> -- >>>>> 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org >>>>> . >>>>> To unsubscribe from this group, send email to >>>>> rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>>>> For more options, visit https://groups.google.com/groups/opt_out. >>>>> >>>>> >>>>> >>>> >>>> >>>> >>>> >>>> -- >>>> 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 https://groups.google.com/groups/opt_out. >>>> >>>> >>>> >>> >>> >>> >>> -- >>> Unni >>> >>> -- >>> 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 https://groups.google.com/groups/opt_out. >>> >>> >>> >> >> >> >> > > -- > 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 https://groups.google.com/groups/opt_out. > > >-- Unni -- 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 https://groups.google.com/groups/opt_out.
hi.. im going to start learning ruby..now dont know even a single thing about ruby,,can anyone please suggest how to start learning..? thank you.. jinet On 21 November 2012 11:59, Unni <unni.tallman-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Cheers ! > > > On Wed, Nov 21, 2012 at 11:55 AM, avinash behera < > aavinash.behera-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> Its working now. Its my fault. >> I forgot to remove an attribute''s validation which I moved from User >> model to Address model. There validation was failing. >> Thanks for helping me out... >> >> >> On Wed, Nov 21, 2012 at 11:46 AM, avinash behera < >> aavinash.behera-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> >>> In new :- >>> >>> @user = User.new >>> @user.build_address # here is it required while building the page ? >>> >>> create :- >>> >>> @user = User.new(params[:user]) >>> @user.save >>> If I use build here, I am not getting those attributes present in >>> address model in UI. >>> >>> Sorry I have communicated wrong. This is the controller >>> >>> >>> On Wed, Nov 21, 2012 at 11:36 AM, Unni <unni.tallman-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >>> >>>> *@user = User.new* >>>> *@user.build_profile* >>>> >>>> Is that all what you have in the controller in create action? >>>> >>>> *@user = User.new(params[:user]) * >>>> >>>> is what one would expect. >>>> >>>> On Wed, Nov 21, 2012 at 11:17 AM, avinash behera < >>>> aavinash.behera-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >>>> >>>>> I tried with that. But somewhere validations are failing. I had >>>>> dropped my db. Trying to create a user. But in console it says: >>>>> User already exists. >>>>> Not sure. >>>>> In controller I have mentioned as @user.build_profile. Is it fine? >>>>> & in erb file, I am using simple_form_for. >>>>> So can we use fields_for there? >>>>> >>>>> >>>>> On Wed, Nov 21, 2012 at 10:44 AM, Unni <unni.tallman-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >>>>> >>>>>> http://stackoverflow.com/a/3283404/1731232 >>>>>> >>>>>> >>>>>> http://api.rubyonrails.org/classes/ActiveModel/MassAssignmentSecurity/ClassMethods.html#method-i-attr_accessible >>>>>> >>>>>> >>>>>> On Wed, Nov 21, 2012 at 10:31 AM, Jim Ruther Nill <jvnill-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>wrote: >>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> On Wed, Nov 21, 2012 at 12:56 PM, avinash behera < >>>>>>> aavinash.behera-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >>>>>>> >>>>>>>> I didn''t get this :- >>>>>>>> *attr_accessible :address_attributes* >>>>>>>> * >>>>>>>> * >>>>>>>> Why we need to define this in user.rb? >>>>>>>> We already have has_one relation. Will it not be accessing those >>>>>>>> attributes in address model automatically? >>>>>>>> >>>>>>> >>>>>>> fields_for uses <association>_attributes as the name of the fields >>>>>>> when you are using >>>>>>> accepts_nested_attributes_for :association so you need to define >>>>>>> this in attr_accessible >>>>>>> >>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> On Wed, Nov 21, 2012 at 10:11 AM, Unni <unni.tallman-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>wrote: >>>>>>>> >>>>>>>>> add >>>>>>>>> >>>>>>>>> *attr_accessible :address_attributes* >>>>>>>>> >>>>>>>>> in your model. >>>>>>>>> >>>>>>>>> Only the fields that you specify via attr_accessible, are open to >>>>>>>>> mass assignment. >>>>>>>>> >>>>>>>>> Unni >>>>>>>>> >>>>>>>>> On Wed, Nov 21, 2012 at 10:02 AM, Avi <aavinash.behera-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>wrote: >>>>>>>>> >>>>>>>>>> Hello All, >>>>>>>>>> >>>>>>>>>> I am stuck in nested attributes:- >>>>>>>>>> here is my code :- >>>>>>>>>> >>>>>>>>>> User.rb :- >>>>>>>>>> has_one :address >>>>>>>>>> accepts_nested_attributes_for :address >>>>>>>>>> >>>>>>>>>> Address.rb :- >>>>>>>>>> >>>>>>>>>> belongs_to :user >>>>>>>>>> >>>>>>>>>> _form.html.erb:- >>>>>>>>>> >>>>>>>>>> <%= simple_form_for @user ,:validate => true do |f| %> >>>>>>>>>> <%= f.fields_for :address do |d| %> >>>>>>>>>> <%= d.input :first_name %> >>>>>>>>>> <%= d.input :last_name %> >>>>>>>>>> <% end %> >>>>>>>>>> <%= f.input :email %> >>>>>>>>>> <% end %> >>>>>>>>>> >>>>>>>>>> in user_controller.rb:- >>>>>>>>>> In new as well as create method I tried with:- >>>>>>>>>> @user = User.new >>>>>>>>>> @user.build_profile >>>>>>>>>> >>>>>>>>>> But still I am getting the error as :- >>>>>>>>>> >>>>>>>>>> Can''t mass-assign protected attributes: address_attributes >>>>>>>>>> >>>>>>>>>> Any Suggestions ?? >>>>>>>>>> >>>>>>>>>> Thanks.... >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> -- >>>>>>>>>> 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 >>>>>>>>>> To view this discussion on the web visit >>>>>>>>>> https://groups.google.com/d/msg/rubyonrails-talk/-/dd447A7hSYwJ. >>>>>>>>>> For more options, visit https://groups.google.com/groups/opt_out. >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> -- >>>>>>>>> Unni >>>>>>>>> >>>>>>>>> -- >>>>>>>>> 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 https://groups.google.com/groups/opt_out. >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> -- >>>>>>>> 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 https://groups.google.com/groups/opt_out. >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> -- >>>>>>> ------------------------------------------------------------- >>>>>>> visit my blog at http://jimlabs.heroku.com >>>>>>> >>>>>>> -- >>>>>>> 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 https://groups.google.com/groups/opt_out. >>>>>>> >>>>>>> >>>>>>> >>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> Unni >>>>>> >>>>>> -- >>>>>> 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 https://groups.google.com/groups/opt_out. >>>>>> >>>>>> >>>>>> >>>>> >>>>> >>>>> >>>>> >>>>> -- >>>>> 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org >>>>> . >>>>> To unsubscribe from this group, send email to >>>>> rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>>>> For more options, visit https://groups.google.com/groups/opt_out. >>>>> >>>>> >>>>> >>>> >>>> >>>> >>>> -- >>>> Unni >>>> >>>> -- >>>> 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 https://groups.google.com/groups/opt_out. >>>> >>>> >>>> >>> >>> >>> >>> >> >> -- >> 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 https://groups.google.com/groups/opt_out. >> >> >> > > > > -- > Unni > > -- > 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 https://groups.google.com/groups/opt_out. > > >-- -- 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 https://groups.google.com/groups/opt_out.
On 21 November 2012 12:28, Jinet <jinet.pampara-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > hi.. > im going to start learning ruby..now dont know even a single thing about > ruby,,can anyone please suggest how to start learning..? > thank you..What has that got to do with the subject line (Nested Attributes in Rails 3) and why have you posted a large message with many irrelevant quoted lines? You say you want to learn to use Ruby, but this is a Ruby on Rails list so I assume you want to learn Ruby on Rails. The answer is to start by working through a good rails tutorial such as railstutorial.org (which is free to use online). I assume you already know the basics of html, if not then start there. Also work on your google skills, I am sure that a search for learning ruby rails would have given you many useful answers. If you want to ask more then please start a new thread with an appropriate subject line. Colin -- 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 https://groups.google.com/groups/opt_out.