Skip to content

Instantly share code, notes, and snippets.

@marvin
Created May 17, 2011 20:42
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marvin/977346 to your computer and use it in GitHub Desktop.
Save marvin/977346 to your computer and use it in GitHub Desktop.
integrate image to rails link_to - requires jquery-ui. the code creates 3 icons for show,edit and destroy
<%= link_to content_tag(:span, '', :class => "ui-icon ui-icon-folder-open"), yourname, :title => "Show", :class => "ui-state-default ui-corner-all", :id => "no-border" %>
<%= link_to content_tag(:span, '', :class => "ui-icon ui-icon-gear"), edit_yourname_path(yourname), :title => "Edit", :class => "ui-state-default ui-corner-all", :id => "no-border" %>
<%= link_to content_tag(:span, '', :class => "ui-icon ui-icon-trash"), yourname, :confirm => "Are you sure you?", :title => "Delete", :method => :delete, :class => "ui-state-default ui-corner-all", :id => "no-border" %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment