Skip to content

Instantly share code, notes, and snippets.

@adriand
Created October 11, 2013 14:35
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 adriand/6935723 to your computer and use it in GitHub Desktop.
Save adriand/6935723 to your computer and use it in GitHub Desktop.
Ruby case/when for class
# this does not work:
case @object.class
when ModelHome then path_for_model_home
end
# this works:
case @object
when ModelHome then path_for_model_home
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment