Skip to content

Instantly share code, notes, and snippets.

@cored
Created June 21, 2013 13:56
Show Gist options
  • Save cored/5831334 to your computer and use it in GitHub Desktop.
Save cored/5831334 to your computer and use it in GitHub Desktop.
module ExhibitsHelper
def exhibit(model, context)
case model.class.name
when 'Post'
if model.picture?
PicturePostExhibit.new(model, context)
else
TextPostExhibit.new(model, context)
end
else
model
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment