Skip to content

Instantly share code, notes, and snippets.

@Olgagr
Created June 15, 2013 16:43
Show Gist options
  • Save Olgagr/5788696 to your computer and use it in GitHub Desktop.
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
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