Skip to content

Instantly share code, notes, and snippets.

@seanhandley
Created January 8, 2016 17:33
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 seanhandley/6a7fd129175450b3f9fa to your computer and use it in GitHub Desktop.
Save seanhandley/6a7fd129175450b3f9fa to your computer and use it in GitHub Desktop.
<%= link_to "Edit", @model.edit_path %>
module EditPath
include Rails.application.routes.url_helpers
include ActionController::Base.helpers
def edit_path
url_for controller: self.class.pluralize, action: 'edit'
end
end
class Model < ActiveRecord::Base
include EditPath
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment