The best way I can describe what I'm looking for is to show you the failed code I've tried thus far:
case car
when ['honda', 'acura'].include?(car)
# code
when 'toyota' || 'lexus'
# code
end
I've got about 4 or 5 different when …
I use HAML in my rails project for my html templates.
I would like to figure out if its possible to divide a very long line and make it a couple of rows:
%a.open-service{href: '#', data: {
service_…
When I do the following:
h = { "a": 123 }
Ruby converts the key to a symbol automatically.
h[:a] # => 123
h["a"] # => nil
How can I prevent this behaviour? I created the hash with a string key, and would like to …