Foundation 6 with Rails Simple Form

The simple form includes the Foundation 5 template.

However, I cannot find the template files modified for Foundation 6 on the Internet.

How well do generated forms work with Foundation 6? Also, any generous share of the Foundation 6 template or tips for modifying an existing template?

+7
ruby-on-rails zurb-foundation simple-form zurb-foundation-6
source share
3 answers

I'm not sure that simple_form can be customized to provide what Foundation 6 requires for error fields.

Until I can figure it out (if, if, if), I have this hack using Sass @extend :

 // TODO: This is a hack to get Foundation 6 styles on simple_form // elements with errors. .input.error { label { @extend .is-invalid-label; } input, textarea, select { @extend .is-invalid-input; } small.error { @extend .form-error; @extend .is-visible; } } 

Are you unhappy with this answer? So do I. I hope someone can β€œshow me” on this with a better answer.

+8
source share

Simple progress, you can set the following in the simple_form.rb configuration file:

 config.wrappers .... do |c| ... c.use :error, wrap_with: { tag: :small, class: 'form-error is-visible' .. end 

and error messages will be formatted. However, I did not find a solution for labels and inputs, so the @Chris solution for labels and inputs is still needed. However, if you do not need red labels and inputs, this is enough

+1
source share

To get hints (for example, help text), edit it correctly, change config / simple_form_foundation.rb and add:

 b.use :hint, wrap_with: { tag: :p, class: 'help-text' } 
0
source share

All Articles