willinteractive / will-style

WILL styles for webapps.
0 stars 0 forks source link

I can't get class: to work on dropdown buttons #30

Closed chorn99 closed 10 years ago

chorn99 commented 10 years ago

I put:

<%= d.button, class: "expand" do %>
  <%= fa_icon "check-square-o" %> Tracker
<% end %>

and get:

/Users/carolinehorn/Development/update-to-foundation/will-style-guide/app/views/templates/tracker.html.erb:81: syntax error, unexpected tLABEL ...uffer.append= d.button, class: "expand" do @output_buffer.s... ... ^ /Users/carolinehorn/Development/update-to-foundation/will-style-guide/app/views/templates/tracker.html.erb:81: syntax error, unexpected keyword_do, expecting keyword_end ...= d.button, class: "expand" do @output_buffer.safe_append=' ... ^ /Users/carolinehorn/Development/update-to-foundation/will-style-guide/app/views/templates/tracker.html.erb:271: syntax error, unexpected keyword_ensure, expecting end-of-input

chadmoone commented 10 years ago

Remove the comma:

<%= d.button class: "expand" do %>
  <%= fa_icon "check-square-o" %> Tracker
<% end %>

If you think about it with the parenthesis back in the method call, it's easier to see why you don't want the comma there:

d.button(, class: "expand", &codeblock)
# the code block is what you're defining between 'do' and 'end'