ruby on rails - Using font awesome with formtastic submit button -


i have submit button on form:

= semantic_form_for record |form|   = form.actions     = form.submit 'save' 

i want add icon fontawesome, link_to can use block:

= link_to record   = fa_icon 'save'   save 

but doesn't work formtastic's form.submit.

i tried:

= form.submit fa_icon('save') = form.submit fa_icon('save').html_safe 

but both renders escaped html.

how add font-awesome icon <button> tag?

try using capture set label, in:

- label = capture   = fa_icon 'save'   save = form.button label 

this seems work form.button, not form.submit. you'll have use form.button label, type: :submit.


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -