In my code I use the aristo design buttons, I insert them like:
%button.aristo-default
« My button text
This works very inconvenient cause sometimes I need a link on the button and that is not possible with this code without using query on click events { :onclick => ” )
What would be a good way to implement a link in rails and make it look like a button, just plain CSS hacking or are there some other good methods?
UPDATE:
Since I’m only looking to make a link look like a button, I think I better look for a solution to do so in CSS. Using the button element implies a form post wich I don’t care about, just getting my link “buttoned”
Depending on what you are trying to do, suggest using the
button_tohelper. This helps implement a POST to a specified URL (or you can specify other HTTP verbs if those are appropriate). See here for Rails documentation onbutton_toAlternatively, if you want a form tag helper, try
button_tag– you can read more about this here.If you are just looking to take a link and style it as a button (keeping in mind that the general philosophy is that buttons are meant for those links/actions that result in something changing), you could just give your
<a>element a class ofbuttonand style that using CSS.