6

我都试过:

= f.submit, :class => "form_submit"

= f.submit { :class => "form_submit" }

它工作得很好

= f.submit

这是我的完整导轨表格。

= form_for @organization do |f|
  %div
    .description
      = f.label :description
    = f.text_area :description, :rows => 4, :class => 'ckeditor'
  = f.submit, :class => "form_submit"
4

2 回答 2

5
= f.submit 'button_name',:class => "form_submit"
于 2013-08-22T07:28:27.157 回答
4

那将是

= f.submit 'Button', class: 'custom-class'

如果您想让 Rails 处理文本,请使用nil

= f.submit nil, class: 'custom-class'
于 2013-08-22T07:29:37.010 回答