Give form a CSS class using simple_form_for

前端 未结 2 1679
春和景丽
春和景丽 2020-12-29 04:17

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, :cl         


        
相关标签:
2条回答
  • 2020-12-29 04:43

    this would work

    <%= simple_form_for @admin_artist, :html=> { class: 'foobarbaz' } do |f| %>
    
    0 讨论(0)
  • 2020-12-29 05:08

    You should use :html like this:

    <%= simple_form_for @admin_artist, :html => { role: 'form', class: 'foobarbaz' } do |f| %>
    
    0 讨论(0)
提交回复
热议问题