Created
January 8, 2016 17:33
-
-
Save seanhandley/6a7fd129175450b3f9fa to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%= link_to "Edit", @model.edit_path %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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