Skip to content

Instantly share code, notes, and snippets.

@adriand adriand/when.rb
Created Oct 11, 2013

Embed
What would you like to do?
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
You can’t perform that action at this time.