Hi,
I am using a FormBuilder to help with DRY-out my views where forms are
displayed in tables. However most examples of this seem to use the
same approach of using a view helper to combine the call to the
remote_form_for (etc...) method with the encapsulating table tags.
Doing it this way you end up with
<table><form></form></table> which
isn''t strictly valid and which Firefox enforces although IE
doesn''t.
Hence everything displays okay in IE but not Firefox.
Has anyone used a technique to get around this? Does it involve
overriding the remote_form_for (as used in this case) helper like I do
with the other form helper methods, somehow inserting <table> tags
inside the generated <form> tags?
Form helper method used in place of basic remote_form_for helper:
def tabular_remote_form_for(name, *args, &proc)
# concat("<table class=''style3''>",
proc.binding)
options = args.last.is_a?(Hash) ? args.pop : {}
options = options.merge(:builder => TabularFormBuilder)
args = (args << options)
remote_form_for(name, *args, &proc)
# concat("</table>", proc.binding)
end
...and in the view
<% tabular_remote_form_for :product, :url =>
product_path(@product), :html => { :method => :put } do |form| %>
<table class="style3">
<%= render :partial => ''form'', :locals => {
:form => form } %>
</table>
<% end %>
Thanks, Andrew
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---
Andrew Edwards
2008-Feb-24 12:04 UTC
Re: Creating Tabular FormBuilder - Form/Table Tag Order
I should also say, the code shows how I am currently avoiding the issue by manually adding <table> tags to each form. Ideally these should be inserted by the builder. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---