Class: Omnom::PostsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/omnom/posts_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#render_404

Instance Method Details

#update_allObject



3
4
5
6
7
8
9
# File 'app/controllers/omnom/posts_controller.rb', line 3

def update_all
  if Post.where(id: params[:ids]).update_all(params[:post])
    render json: {success: true}
  else
    render json: {success: false}, status: 500
  end
end