Hi , there , first of all i wanna to express my regard to the Rails 3 dev. team''s effort , the work is really amazing ! Really speed up a lot the performance !! Well , i still a rookie guy and have a question for ask T_T : i have two association ARs : User has_one Account , and i have used the accepts_nested_forms for get all create up for only one line of code in view : @user = User.new(params[:user] until this part i have done with the tutorial of RailsCast http://railscasts.com/episodes/196-nested-model-form-part-1 However , in my Account AR , there is a birthdate colum , ( t.date :birthdate in the migration) , i have used the date_select helper to generate the corresponding html code , and get the return values : year , month , day with birthday(1i) , birthday(2i) , birthday(3i) , i have tried to use the virtual attribute in the Account AR for combine all these values , but i can''t refer them with attr_accessor :"birthday(1i)", :"birthday(2i)" , :"birthday(3i)". I don''t know if there is another solution for kind of this , or another way to get my objective: get date(year, month, day) from html and combine name all in a birthday value for save @_@?? Thx in advance ! -- 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.
On Jun 4, 9:59 pm, ShellScripter <chengjh...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> However , in my Account AR , there is a birthdate colum , > ( t.date :birthdate in the migration) > , i have used the date_select helper to generate the corresponding > html code , and > get the return values : year , month , day with birthday(1i) , > birthday(2i) , birthday(3i) > , i have tried to use the virtual attribute in the Account AR for > combine all these values , > but i can''t refer them with > attr_accessor :"birthday(1i)", :"birthday(2i)" , :"birthday(3i)". >You shouldn''t need to - as long as you use date_select (with the attribute name birthdate) and then pass that into User.new (or User.update_attributes etc.) activerecord will do the work of sticking the individual parameters back together to get a Date object Fred -- 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.
Thx a lot , that''s true , it just was my mistake ... :o> You shouldn''t need to - as long as you use date_select (with the > attribute name birthdate) and then pass that into User.new (or > User.update_attributes etc.) activerecord will do the work of sticking > the individual parameters back together to get a Date object > > Fred-- 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.