0

I had some tags like this:

<div class="container">
<div class="row">
    <div class="col-md-8">
       <button type="button" class="btn btn-default btn-lg">
  <span class="glyphicon glyphicon-user" aria-hidden="true" href="/groups"></span> Group/Provider
       </button>
       <button type="button" class="btn btn-default btn-lg">
  <span class="glyphicon glyphicon-usd" aria-hidden="true"></span> Billing
       </button>

<!-- etc -->

This worked great, the buttons were lining side by side. Then when I went to this: Button_to the buttons no longer arrange side by side:

 <%= button_to(groups_url, :class => 'btn btn-default btn-lg') do %> 
    <span class="glyphicon glyphicon-user" aria-hidden="true"></span>Group
 <% end %>

 <%= button_to(providers_url, :class => 'btn btn-default btn-lg') do %> 
    <span class="glyphicon glyphicon-user" aria-hidden="true"></span>Provider
<% end %>       

Even though the same class was being used, any ideas? Guessing button_to has some specific styling II would like to use the button_to url helper but I want my form to look nice...ideas suggestions?

infused
  • 24,000
  • 13
  • 68
  • 78
Codejoy
  • 3,722
  • 13
  • 59
  • 99

1 Answers1

2

Rails button_to actually creates a form and an input (see the docs for example markup). Instead, I think you just want a link styled like a button, so use link_to and add the Bootstrap button classes:

link_to('Button Text', groups_url, :class => 'btn btn-default btn-large)
infused
  • 24,000
  • 13
  • 68
  • 78