Sha256: 050790fec3d9fe19a6cad4aacbd52b20703700198483dc02bfd263c945b63e09
Contents?: true
Size: 880 Bytes
Versions: 25
Compression:
Stored size: 880 Bytes
Contents
module Pageflow class EditLocksController < Pageflow::ApplicationController before_filter :authenticate_user! respond_to :json def create entry = Entry.find(params[:entry_id]) authorize!(:edit, entry) entry.edit_lock.acquire(current_user, edit_lock_params) entry.snapshot(:creator => current_user) respond_with(entry.reload.edit_lock, :location => entry_edit_lock_url(entry)) end def update entry = Entry.find(params[:entry_id]) authorize!(:edit, entry) entry.edit_lock.acquire(current_user, edit_lock_params) head :no_content end def destroy entry = Entry.find(params[:entry_id]) entry.edit_lock.release(current_user) head :no_content end protected def edit_lock_params params.permit(:edit_lock => [:force, :id]).fetch(:edit_lock, {}) end end end
Version data entries
25 entries across 25 versions & 1 rubygems