Rails Multiple CSS Classes

I searched online but found little help on this quickly, so figured I’d post what I found under a good name.

If you want more than one CSS class when using a Rails helper, use the format:

  <%= f.label :method, :class => ['class1', 'class2'] %>

If you only have one CSS class that you want to use, you can use the more basic form as well:

  <%= f.label :method, :class => 'class1' %>

Categories: development

« Gamification Is Not Entirely Bullshit "Finding A Technical Cofounder" Blog Roundup »

Comments