Hi. I need to get the apropiate tag helper given a resource attribute. I''m pretty much sure rails already has something to do this, but i don''t remember where. My ugly solution is this: def standard_form_method form, resource, attribute case resource.column_for_attribute(attribute).type when :text form.text_area(attribute) when :binary, :boolean form.check_box(attribute) else #when :string, :integer, :float, :decimal #when :datetime, :timestamp, :time, :date form.text_field(attribute) end end then in erb you can call, inside a form (EDIT.RHTML) <% form_for :resource, :url => resource_path(@resource), :html => { :method => :put } do |f| -%> <% @resource.each_attribute do |attribute| -%> <% ar_form_method(f, @resource, attribute) -%> <% end -%> <%= submit_tag "Send" %> <% end %> -- 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 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 -~----------~----~----~----~------~----~------~--~---