Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Give form a CSS class using simple_form_for

Tags:

Here's what I've tried, and the simple_form_for call ignored my class setting.

# Rails code in view:
<%= simple_form_for @admin_artist, :class => 'foobarbaz' do |f| %>

# Renders:
<form accept-charset="UTF-8" action="/admin/artists" class="simple_form new_admin_artist" id="new_admin_artist" method="post" novalidate="novalidate">

Any suggestions?

like image 519
sergserg Avatar asked Jun 08 '13 03:06

sergserg


1 Answers

this would work

<%= simple_form_for @admin_artist, :html=> { class: 'foobarbaz' } do |f| %>
like image 175
Sagar.Patil Avatar answered Dec 22 '22 00:12

Sagar.Patil