Here is a cool way you can update columns in a table without writing any SQL using ActiveRecord. Suppose you have a form with checkboxes that are for deleting posts for the ones that are checked:
<input type="checkbox" name="posts[]" value="<%= post.id %>">
Now you can update this in the method of your controller that this form posts to:
Post.update_all({:removed=>true}, {:id=>params[:posts]})
ActiveRecord will take of the fact that you want to update 1 record or multiple!
Tags: activerecord, bulk update, rails, sql
