My view rhtml contains the following <% for contactaddress in @contact_address %> <%= text_field "contactaddress", "addr_line1", "size" => 50 %></ <%end%> In the above code @contactact_address contains several contact address objects. The for loop iterates each of them and tries to show the value of model attribute addr_line1 in the text input box. The problem In the rhtml it creates a text input field but it doesn''t show value of addr_line1 in the text input box. What is wrong here? Thanks in advance for your help.... Regards Venu -- Posted via http://www.ruby-forum.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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Try doing <% for @contactaddress in @contact_addresses %> On Jan 14, 2008 4:37 PM, Venu Vallayil <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > My view rhtml contains the following > > <% for contactaddress in @contact_address %> > <%= text_field "contactaddress", "addr_line1", "size" => 50 %></ > <%end%> > > > In the above code @contactact_address contains several contact address > objects. The for loop iterates each of them and tries to show the value > of model attribute addr_line1 in the text input box. > > The problem > > In the rhtml it creates a text input field but it doesn''t show value of > addr_line1 in the text input box. > > What is wrong here? Thanks in advance for your help.... > > Regards > Venu > -- > Posted via http://www.ruby-forum.com/. > > > >-- Ryan Bigg http://www.frozenplague.net Feel free to add me to MSN and/or GTalk as this email. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Ryan Bigg wrote:> Try doing <% for @contactaddress in @contact_addresses %> > > On Jan 14, 2008 4:37 PM, Venu Vallayil > <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> > wrote: > >> of model attribute addr_line1 in the text input box. >> -- >> Posted via http://www.ruby-forum.com/. >> >> > >> > > > -- > Ryan Bigg > http://www.frozenplague.net > Feel free to add me to MSN and/or GTalk as this email.Ryan.....an instance variable won''t be allowed....I got error message saying this. Thanks Venu -- Posted via http://www.ruby-forum.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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 14 Jan 2008, at 06:07, Venu Vallayil wrote:> > My view rhtml contains the following > > <% for contactaddress in @contact_address %> > <%= text_field "contactaddress", "addr_line1", "size" => 50 %></ > <%end%> > > > In the above code @contactact_address contains several contact address > objects. The for loop iterates each of them and tries to show the > value > of model attribute addr_line1 in the text input box. >text_field expects the first parameer to be the name of an instance variable. Either create an instance variable with that name, or use text_field_tag or look into fields_for which allows you to escape that convention. Fred> The problem > > In the rhtml it creates a text input field but it doesn''t show value > of > addr_line1 in the text input box. > > What is wrong here? Thanks in advance for your help.... > > Regards > Venu > -- > Posted via http://www.ruby-forum.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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---