Skip to content

Instantly share code, notes, and snippets.

@justinko
Created October 7, 2011 07:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save justinko/1269680 to your computer and use it in GitHub Desktop.
Save justinko/1269680 to your computer and use it in GitHub Desktop.
module ViewDecorator
include RailsViewHelpers
def link_to_root
link_to # ...
end
end
# Most likely you won't do this because you need to
# pass some kind of data/state
@non_model_object = Object.new.extend(ViewDecorator)
class NonModelObject
include ViewDecorator
end
@non_model_object = NonModelObject.new
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment