Hello, I would like to wrap the class type-text around each label/text_field. There must be a better way than my example below? I don''t know how to do this without an object to loob through :) <% content_tag :div, :class => "type-text" do -%> <%= label(:user, :login, "Username") %><%= f.text_field :login %> <% end %> <% content_tag :div, :class => "type-text" do -%> <%= label(:user, :firstname, "Firstname") %><%f.text_field :firstname %> <% end %> <% content_tag :div, :class => "type-text" do -%> <%= label(:user, :lastname, "Lastname") %><%= f.text_field :lastname %> <% end %> Best regards. Asbjørn Morell. --~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
What you need is a custom form buider -> onrails.org/articles/2008/06/13/advanced-rails-studio-custom-form-builder - Maurício Linhares alinhavado.wordpress.com (pt-br) | blog.codevader.com (en) On Tue, Feb 10, 2009 at 8:08 AM, atmorell <atmorell-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Hello, > > I would like to wrap the class type-text around each label/text_field. > There must be a better way than my example below? I don''t know how to > do this without an object to loob through :) > > <% content_tag :div, :class => "type-text" do -%> > <%= label(:user, :login, "Username") %><%= f.text_field :login %> > <% end %> > > <% content_tag :div, :class => "type-text" do -%> > <%= label(:user, :firstname, "Firstname") %><%> f.text_field :firstname %> > <% end %> > > <% content_tag :div, :class => "type-text" do -%> > <%= label(:user, :lastname, "Lastname") %><%= f.text_field :lastname > %> > <% end %> > > Best regards. > Asbjørn Morell. > > >--~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---