Skip to content

Instantly share code, notes, and snippets.

@joshrendek
Created December 24, 2010 03:55
Show Gist options
  • Save joshrendek/753880 to your computer and use it in GitHub Desktop.
Save joshrendek/753880 to your computer and use it in GitHub Desktop.
def get_object
type = params['event_id'] ? 'event' : 'person'
value = type.classify.constantize.find(params[:"#{type}_id"])
name = '@' + type
instance_variable_set(name , value)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment