Created
March 16, 2016 04:32
-
-
Save coderdan/6a1df7175999fdd6bd15 to your computer and use it in GitHub Desktop.
To Param
This file contains hidden or 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
def site_path(site) | |
val = if site.respond_to?(:to_param) | |
site.to_param | |
else | |
site | |
end | |
"/sites/#{val}" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment