Created
June 15, 2013 16:43
-
-
Save Olgagr/5788696 to your computer and use it in GitHub Desktop.
Set partial path in the class which does not inherit fro active model
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
class Timeline | |
extend ActiveModel::Naming # it's better approach | |
def initialize(user) | |
@user = user | |
end | |
def to_partial_path | |
'path/to/partial' # but there is a better way(see above) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment