rubyonrailsin

A Ruby and Rails talk

Saturday, March 20, 2010


[Rails] Displaying an image in a Rails form_for

by rubyonrailsin 0 comments

Tag


Share this post:
Design Float
StumbleUpon
Reddit

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@googlegroups.com.
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.

No comments:

Post a Comment

Subscribe feeds via e-mail

Blog Archive