Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<%= 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
You can’t perform that action at this time.