Skip to content

Instantly share code, notes, and snippets.

@gr4y
Created May 9, 2010 20:09
Show Gist options
  • Save gr4y/395373 to your computer and use it in GitHub Desktop.
Save gr4y/395373 to your computer and use it in GitHub Desktop.
<div class="nav">
<%= link_if_action ["new","edit","show"], t("project.back"), projects_path %>
<%= link_if_action "index", t("project.new"), new_project_path %>
</div>
def link_if_action(actions, label, path)
if actions.include?(params[:action])
link_to label, path
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment