简体   繁体   中英

HAML =form.submit add a class with t() stopping it

I need to add a class of btn and btn-primary to:

= f.submit t('.save',  default: t('helpers.links.save'))
- if question_set.shared?

So that it matches the rest of my page. But no matter what I do it does not put those classes in.

I have tried:

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

Placed it everywhere I just cant get it to work. If I place it in front of the t( it errors out.

万一有人想知道如何做这样的事情,它就这样工作。

= f.submit t('.save', default: t('helpers.links.save')), class: 'btn btn-primary'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM