Hi, I''ve got a public\images\DownArrow.jpg and app\views\expenses\new.html.erb that want to present this image in the following context: <p> <%= f.label :vendor %><br /> <%= f.text_field :vendor %> <%= f.image "DownArrow.jpg" %> <br> <%= select_tag "test", options_for_select(@current_vendors.collect { |v| v.nickname }), {:multiple => true} %> </p> But Rails gushes the unforgiving response: undefined method `image'' for #<ActionView::Helpers::FormBuilder: 0x48194e0> I couldn''t find anything helpful in: -- http://api.rubyonrails.org/classes/ActionView/Helpers/FormHelper.html -- http://api.rubyonrails.org/http://api.rubyonrails.org/ -- Google Any ideas? Thanks in Advance, Richard -- 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.
Can you not use an <%= image_tag("DownArrow.jpg") %> ? On Mar 20, 2:29 pm, RichardOnRails <RichardDummyMailbox58...-FtJgd9dCuO3JTKoYRCtP1UEOCMrvLtNR@public.gmane.org> wrote:> Hi, > > I''ve got a public\images\DownArrow.jpg > and app\views\expenses\new.html.erb that want to present this image in > the following context: > > <p> > <%= f.label :vendor %><br /> > <%= f.text_field :vendor %> > <%= f.image "DownArrow.jpg" %> > <br> > <%= select_tag "test", > options_for_select(@current_vendors.collect { |v| v.nickname }), > {:multiple => true} %> > </p> > > But Rails gushes the unforgiving response: > undefined method `image'' for #<ActionView::Helpers::FormBuilder: > 0x48194e0> > > I couldn''t find anything helpful in: > --http://api.rubyonrails.org/classes/ActionView/Helpers/FormHelper.html > --http://api.rubyonrails.org/http://api.rubyonrails.org/ > -- Google > > Any ideas? > > Thanks in Advance, > Richard-- 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.
On 20 March 2010 18:29, RichardOnRails <RichardDummyMailbox58407-gP6xRNRnnqSxhq/XJNNIW0EOCMrvLtNR@public.gmane.org> wrote:> Hi, > > I''ve got a public\images\DownArrow.jpg > and app\views\expenses\new.html.erb that want to present this image in > the following context: > > <p> > <%= f.label :vendor %><br /> > <%= f.text_field :vendor %> > <%= f.image "DownArrow.jpg" %>I think that should be <%= image_tag "DownArrow.jpg" %> Colin> <br> > <%= select_tag "test", > options_for_select(@current_vendors.collect { |v| v.nickname }), > {:multiple => true} %> > </p> > > But Rails gushes the unforgiving response: > undefined method `image'' for #<ActionView::Helpers::FormBuilder: > 0x48194e0> > > I couldn''t find anything helpful in: > -- http://api.rubyonrails.org/classes/ActionView/Helpers/FormHelper.html > -- http://api.rubyonrails.org/http://api.rubyonrails.org/ > -- Google > > Any ideas? > > Thanks in Advance, > Richard > > -- > 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. > >-- 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.
Hi Colin,> I think that should be > <%= image_tag "DownArrow.jpg" %>I tried that once merely changing f.image to f.image_tag, which I had tried earlier. Happily, then I noticed that you also omitted the "f.". So you were spot-on! Great job! I superficially thought that all the things in the block had to be f.xxx or generated html would be out of order, or something. Now I realize the html is generated in the order its created, regardless of what method is invoked to create it. At least, that''s how I''m thinking about it now. BTW, the rest of that code in that section is: <p> <%= f.label :vendor %><br /> <%= f.text_field :vendor %> <%= image_tag "DownArrow.jpg" %> <br> <%= select_tag "test", options_for_select(@current_vendors.collect { |v| v.nickname }), {:multiple => true} %> </p> So I no longer need the sidebar I could never get working. The select_tag was what I really wanted, but I didn''t go about seeking properly for a week. Whew, I''m glad that''s behind me. Best wishes, Richard On Mar 20, 5:09 pm, Colin Law <clan...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> On 20 March 2010 18:29, RichardOnRails > > <RichardDummyMailbox58...-gP6xRNRnnqSxhq/XJNNIW0EOCMrvLtNR@public.gmane.org> wrote: > > Hi, > > > I''ve got a public\images\DownArrow.jpg > > and app\views\expenses\new.html.erb that want to present this image in > > the following context: > > > <p> > > <%= f.label :vendor %><br /> > > <%= f.text_field :vendor %> > > <%= f.image "DownArrow.jpg" %> > > I think that should be > <%= image_tag "DownArrow.jpg" %> > > Colin > > > <br> > > <%= select_tag "test", > > options_for_select(@current_vendors.collect { |v| v.nickname }), > > {:multiple => true} %> > > </p> > > > But Rails gushes the unforgiving response: > > undefined method `image'' for #<ActionView::Helpers::FormBuilder: > > 0x48194e0> > > > I couldn''t find anything helpful in: > > --http://api.rubyonrails.org/classes/ActionView/Helpers/FormHelper.html > > --http://api.rubyonrails.org/http://api.rubyonrails.org/ > > -- Google > > > Any ideas? > > > Thanks in Advance, > > Richard > > > -- > > 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 athttp://groups.google.com/group/rubyonrails-talk?hl=en.-- 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.
Hi Joshua, Thanks for your response.> Can you not use an <%= image_tag("DownArrow.jpg") %>Yes. That''s essentially what I wound up with: <%= image_tag "DownArrow.jpg" %> My problem was that I had tried <%= f.image_tag "DownArrow.jpg" %> and then <%= f.image "DownArrow.jpg" %>. Colin pointed out the plain image_tag without the "f." is what I needed. Best wishes, Richard On Mar 20, 3:02 pm, Joshua Martin <josmar52...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Can you not use an <%= image_tag("DownArrow.jpg") %> ? > > On Mar 20, 2:29 pm, RichardOnRails > > <RichardDummyMailbox58...-FtJgd9dCuO3JTKoYRCtP1UEOCMrvLtNR@public.gmane.org> wrote: > > Hi, > > > I''ve got a public\images\DownArrow.jpg > > and app\views\expenses\new.html.erb that want to present this image in > > the following context: > > > <p> > > <%= f.label :vendor %><br /> > > <%= f.text_field :vendor %> > > <%= f.image "DownArrow.jpg" %> > > <br> > > <%= select_tag "test", > > options_for_select(@current_vendors.collect { |v| v.nickname }), > > {:multiple => true} %> > > </p> > > > But Rails gushes the unforgiving response: > > undefined method `image'' for #<ActionView::Helpers::FormBuilder: > > 0x48194e0> > > > I couldn''t find anything helpful in: > > --http://api.rubyonrails.org/classes/ActionView/Helpers/FormHelper.html > > --http://api.rubyonrails.org/http://api.rubyonrails.org/ > > -- Google > > > Any ideas? > > > Thanks in Advance, > > Richard-- 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.