How do I use CSS with a link_to with multiple options?

I’m trying to use a CSS class with a link_to that has multiple options:

<%= link_to ‘Destroy’, { :action => ‘destroy’, :id => @category },
{:class => ‘button’, :confirm => ‘Are you sure?’, :post => true} %>

This one is working correctly:

<%= link_to ‘Edit’, {:action => ‘edit’, :id => @category}, :class =>
‘button’ %>

Any ideas? Thanks

George wrote:

I’m trying to use a CSS class with a link_to that has multiple options:

<%= link_to ‘Destroy’, { :action => ‘destroy’, :id => @category },
{:class => ‘button’, :confirm => ‘Are you sure?’, :post => true} %>

Seems to work for me. I tried the same and this is the resultant html
fragment.
Edit

Raja Venkataraman wrote:

George wrote:

I’m trying to use a CSS class with a link_to that has multiple options:

<%= link_to ‘Destroy’, { :action => ‘destroy’, :id => @category },
{:class => ‘button’, :confirm => ‘Are you sure?’, :post => true} %>

Seems to work for me. I tried the same and this is the resultant html
fragment.
Edit

I guess it sorta works. The hover isn’t working. Also, some other
attributes aren’t showing on the Destroy link. Here’s part of my CSS
file:

a.button {
background-color : #2B4B7D;
color: White;
border: 1px solid white;
padding: 2px;
text-decoration : none;
font-size : small;
}

a:hover.button {
background-color : white;
color: black;
border: 1px solid black;
padding: 0;
text-decoration : none;
}

a:link.button {
background-color : #2B4B7D;
color: White;
border: 1px solid white;
padding: 0;
text-decoration : none;
}

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs