parm530
4/18/2018 - 8:37 PM

link_to -> button

CSS used to convert a link_to into a button

The HTML

<%= link_to "Home", "/home", class: "btn-style" %>

The CSS

.btn-style {
  // padding adds the space between the text so no centering is needed and also no height/width
  padding: 10px 15px; 
  background-color: green;
  color: #FFF;
  // add borders and other touch ups to make it feel more like a button
  
}