images = Hash.new
Dir.glob("public/img/buildings/*").each do |s|
s.gsub!("public/img/buildings/", "")
images["<img src='/img/buildings/".html_safe + s + "'>".html_safe] = s
end
form do |f|
f.inputs "Building" do
f.input :name
*f.input :image, :as => :radio , :collection => images*
end
f.actions
end
On Monday, June 16, 2014 3:04:28 PM UTC+8, Alex Ryder wrote:
>
> Hello,
>
> I would like to ask, how am I going to integrate an image tag during edit
> on formtastic for a collection of array of images?
>
> form do |f|
> f.inputs "Building" do
> f.input :name
> *f.input :image, :as => :radio , :collection =>
> Dir.glob("public/img/buildings/*")*
> end
> f.actions
> end
>
> Thank you in advance,
>
> Alex
>
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/rubyonrails-talk/350f3f5d-8b27-4320-a3b3-036d8bd6339b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.