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 -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Raja Venkataraman
2006-Oct-16 02:48 UTC
Re: How do I use CSS with a link_to with multiple options?
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. <a href="/something/edit" class="button" onclick="if (confirm(''Are you sure'')) { var f = document.createElement(''form''); this.parentNode.appendChild(f); f.method = ''POST''; f.action = this.href; f.submit(); };return false;">Edit</a> -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
George Pasley
2006-Oct-16 04:42 UTC
Re: How do I use CSS with a link_to with multiple options?
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. > <a href="/something/edit" class="button" onclick="if (confirm(''Are you > sure'')) { var f = document.createElement(''form''); > this.parentNode.appendChild(f); f.method = ''POST''; f.action = this.href; > f.submit(); };return false;">Edit</a>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; } -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---