1

Why doesn't this work?

 # Note the `do` block
 = button_to 'Accept', firefighters_approve_path(entry), class: 'button is-success' do
    i.fa.fa-thumbs-up

undefined method `stringify_keys' for String:0x007fec0bb7bcc8>

Why doesn't this work?

# Note no `do` block
= button_to 'Accept', firefighters_approve_path(entry), class: 'button is-success'
  i.fa.fa-thumbs-up

undefined method `stringify_keys' for String:0x007fec0bc86b40

I want to use slim and fontawesome. What am I missing here?

dsp_099
  • 5,801
  • 17
  • 72
  • 128

2 Answers2

3

According to the documentation, it should be:

= button_to firefighters_approve_path(entry), class: 'button is-success' do
  i.fa.fa-thumbs-up
    |Accept

If you use a block, first argument should be a path and block contains name.

Roman Kiselenko
  • 43,210
  • 9
  • 91
  • 103
1

If you're using the font-awesome-rails gem, you'd be able to use the fa_icon helper:

= button_to fa_icon("thumbs-up", text: "Accept"), firefighters_approve_path(entry), class: 'button is-success'
Richard Peck
  • 76,116
  • 9
  • 93
  • 147