The merge method is a Ruby method that can merge hashes.
post = { name: "Sugar", text: "Hello"} uid = { user_id: "1" } post.merge(uid) #=> {:name=>"Sugar", :text=>"Hello", :user_id=>"1"}
Recommended Posts