[Rails] Re: How to copy a selected value into a text_field

2010-04-15 Thread RichardOnRails
Hi Fred, I employed your code and it looks/works great. I could swear my old code populated an adjacent text-box, but I must have been hallucinating. Thank for you additional post which jump-started my effort for neater code. Best wishes, Richard On Apr 14, 7:02 am, Frederick Cheung wrote: >

[Rails] Re: How to copy a selected value into a text_field

2010-04-14 Thread Frederick Cheung
On Apr 13, 8:03 pm, RichardOnRails wrote: > Hi Frederick, > > Thanks for your additional help with a simpler solution.  I tried to > replace my select_tag approach with the f.select approach: > >     <%= f.select :vendor, @current_vendors %> >     <%# = select_tag "expense[vendor]", >          

[Rails] Re: How to copy a selected value into a text_field

2010-04-13 Thread RichardOnRails
Hi Frederick, Thanks for your additional help with a simpler solution. I tried to replace my select_tag approach with the f.select approach: <%= f.select :vendor, @current_vendors %> <%# = select_tag "expense[vendor]", options_for_select(@current_vendors) %> 1. The f.select

[Rails] Re: How to copy a selected value into a text_field

2010-04-13 Thread Frederick Cheung
On Apr 12, 8:59 pm, RichardOnRails wrote: > PRiyanka and sameera: Thank you both very much!!!  I've been pulling > my hair out for about a week with this thing. > > I didn't realize that the first argument of the select_tag function > apparently identifies the target > of the selected item in th

[Rails] Re: How to copy a selected value into a text_field

2010-04-13 Thread RichardOnRails
Hey, Priyanka and Sameera, I've thought about design I'm aiming for and realized that I can accomplish it in a very straight-forward way. Again, thanks for your great solution to my original problem. Best wishes, Richard On Apr 10, 10:18 pm, RichardOnRails wrote: > In app\views\expenses\new.

[Rails] Re: How to copy a selected value into a text_field

2010-04-12 Thread RichardOnRails
PRiyanka and sameera: Thank you both very much!!! I've been pulling my hair out for about a week with this thing. I didn't realize that the first argument of the select_tag function apparently identifies the target of the selected item in the format "table_name[column_name]". Now that you've giv

[Rails] Re: How to copy a selected value into a text_field

2010-04-12 Thread sameera
hi RichardOnRails Try this <%= select_tag 'expense[vendor]', options_for_select(@current_vendors) %> cheers, sameera On Apr 11, 7:18 am, RichardOnRails wrote: > In app\views\expenses\new.html.erb,  I (mistakenly) replaced the > script/generated: > <%= f.label :vendor %> > <%= f.text_field

[Rails] Re: How to copy a selected value into a text_field

2010-04-11 Thread Priyanka Pathak
RichardOnRails wrote: > In app\views\expenses\new.html.erb, I (mistakenly) replaced the > script/generated: > <%= f.label :vendor %> > <%= f.text_field :vendor %> > with: > <%= f.label :vendor %> > <% @current_vendors = Vendor.find(:all, :order=>"nickname") %> > <%= select_tag "list", options_for