How to escape a dash “-” in a Ruby symbol?
Use single quotes around the symbol name, with the colon prefix: :’data-role’ => ‘button’ And here is a nice reference on symbols: http://www.troubleshooters.com/codecorn/ruby/symbols.htm#_What_do_symbols_look_like After Ruby 1.9 you can also do ‘data-role’: ‘button’