Reputation: 139
I'm using Rails 3.1 and Twitter Bootstrap, but struggling to replicate <a class="btn btn-large" href="">Button!</a>
with a rails helper.
With the CSS giving providing the 'button', I'm not sure whether I should be using link_to
or button_to
, but I DO know that neither of them are giving me the appropriately styled button.
I've tried a variety of combinations, for instance:
<%= button_to "Button!", :class => "btn btn-large" %>
How can I replicate my normal HTML link with a rails helper?
Upvotes: 0
Views: 1439
Reputation: 1491
You should use link_to
:
<%= link_to 'Button!', '#', :class => 'btn btn-large' %>
I use it in this way and it works perfectly.
The button_to
helper generate a form with a button. Here, you just want a link with a button appearance.
Upvotes: 3
Reputation: 20269
You have to specify multiple classse for a HTML element as <element class="foo bar">
, not as <element class="foo" class="bar">
. This might seem slightly counter-intuitive, I agree.
Upvotes: 0