In this post, slice function is used to get only necessary elements of params. What would be the function I should use to exclude an element of params (such as user_id)?
Try this
params = { :title => "title", :other => "other", :body => "body" } params.select {|k,v| [:title, :body].include? k } #=> {:title => "title", :body => "body"}