Ball, Donald A Jr (Library) wrote:
> The proper usage of form_tag nowadays is:
>
> <% form_tag do %>
> blah blah blah
> <% end %>
>
> Supposing I want to use form_tag inside a helper, e.g.
>
> def search_form
> form_tag do
> ... ??? ...
> end
> end
>
> what would I put inside the block? In my other helpers, I build up a
> string and return it.
>
> - donald
I know this post is too old, but I haven't seen anyone answering this
question, so here I go.
I found I could use a form_tag inside a helper method this way:
def search_form
form_tag do
(
text_field_tag( :name ) +
text_field_tag( :lastname )
)
end
I think there should be a cleaner way, but at least this works.
--
Posted via http://www.ruby-forum.com/.
--
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 [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.