How to remove a key from Hash and get the remaining hash in Ruby/Rails?
To add a new pair to Hash I do: {:a => 1, :b => 2}.merge!({:c => 3}) #=> {:a => 1, :b => 2, :c => 3} Is there a similar way to delete a key from Hash ? This works: {:a => 1, :b => 2}.reject! { |k| k == :a } #=> {:b … Read more