Skip to content

Instantly share code, notes, and snippets.

@azuby
Created March 7, 2012 04:17
Show Gist options
  • Save azuby/1990902 to your computer and use it in GitHub Desktop.
Save azuby/1990902 to your computer and use it in GitHub Desktop.
def show_link(object, content = image_tag("view.png", :alt => "View"), *args)
link_to(content, object, args) if can?(:show, object)
end
def link_to_create_association(object, association_class, content = "Add " + association_class.name.titleize, *args)
if can?(:create, association_class)
link_to(content, "#", :class => "add-fields-button", :"data-fields" => association_class.name.underscore, args)
end
end
Error: /app/helpers/application_helper.rb:52: syntax error, unexpected ')', expecting tASSOC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment