Override label class in a custom wrapper

216 views
Skip to first unread message

Andrea Campolonghi

unread,
Mar 28, 2014, 9:56:47 AM3/28/14
to plataformate...@googlegroups.com
I am trying to set up a custom wrapper to use a defined label class different from the default one:


  config.wrappers :half, :tag => 'div', :class => 'form-group', :error_class => 'error' do |b|
    b.use :html5
    b.use :placeholder
    b.use :label, class: 'my custom class'
    b.wrapper :tag => 'div', :class => 'col-lg-6' do |ba|
      ba.use :input
      ba.use :error, :wrap_with => { :tag => 'span', :class => 'help-inline' }
      ba.use :hint,  :wrap_with => { :tag => 'p', :class => 'help-block' }
    end
  end

But looks like nothing works. Label will always be generated using the default defined class.
Also passing the class from the input form append the classes and does not override them.

Any suggestion?

Rafael Mendonça França

unread,
Mar 28, 2014, 9:59:41 AM3/28/14
to PlataformaTec - SimpleForm
This will work on Simple Form master but it will not override. If you need to override I recommend to not set the default one and only set the class in the wrapper.

--
You received this message because you are subscribed to the Google Groups "SimpleForm" group.
To unsubscribe from this group and stop receiving emails from it, send an email to plataformatec-simp...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Andrea Campolonghi

unread,
Mar 28, 2014, 10:01:26 AM3/28/14
to plataformate...@googlegroups.com
Thanks I will try using master.

Andrea

28 Mar 2014 14:59
This will work on Simple Form master but it will not override. If you need to override I recommend to not set the default one and only set the class in the wrapper.
--
You received this message because you are subscribed to a topic in the Google Groups "SimpleForm" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/plataformatec-simpleform/U1M8XGBQw5o/unsubscribe.
To unsubscribe from this group and all its topics, send an email to plataformatec-simp...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
Andrea Campolonghi

Reply all
Reply to author
Forward
0 new messages