Reputation: 1181
My Slim code in my index view
td= link_to 'Destroy', task, method: :delete, data: confirm: 'Are you sure?'
generates a Slim error
syntax error, unexpected tLABEL ...method: :delete, data: confirm: 'Are you sure?'))).to_s)); ... ^
Do you have a clue and understand the error ?
Upvotes: 2
Views: 1149
Reputation: 2677
Your problem is just here:
data: confirm: 'Are you sure?'
change it to
data: {confirm: 'Are you sure?'}
Upvotes: 2
Reputation: 1181
I think that Slim doesn't like the hash "symbole: value" syntaxe.
Indeed, this code is working :
td= link_to 'Destroy', board, :method => :delete, :data => {:confirm => 'Are you sure?'}
Upvotes: 1