Skip to content

Instantly share code, notes, and snippets.

@quirkey
Forked from mrb/gist:1245
Created July 22, 2008 20:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save quirkey/1247 to your computer and use it in GitHub Desktop.
Save quirkey/1247 to your computer and use it in GitHub Desktop.
module ApplicationHelper
def e_tag(model)
eval("link_to image_tag(\'pencil.png\'), edit_#{model.class.name.underscore}_path(model)")
end
def d_tag(model)
eval("link_to image_tag(\'delete.png\'), model, :confirm => \'Are you sure?\', :method => :delete")
end
def n_tag(model)
eval("link_to image_tag(\'add.png\'), new_#{model}_path")
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment