Hello everyone,
in my view, I wrap a form_for around a model:
<% form_for(:
[...]
) do |f| %>
Now I repeat the following very often why I would like to extract it
into a helper:
<%= f.text_field :field_1, :class=>"css_class"%>
<span class="css_class2">xxx</span>
Therefore, I packed it into a helper. Unfortunately, it does not get
interpreted as Code but html text:
def textfield_helper(input1, input2)
returnarray=[]
returnarray << f.text_field :#{input1}, :class=>\"css_class\"
returnarray << "<span class=\"css_class2\">"
returnarray << xxx
returnarray << "</span>"
end
Any ideas how to rephrase this: returnarray <<
f.text_field :#{input1}, :class=>\"css_class\" line?
Everything else seems to be ok!
Thank you very much in advance,
memex
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---