Sha256: 81c05cc1e74bc08dd58cee4b035e4504ba7f7fb38f8dde521b88dea7c72c5be1
Contents?: true
Size: 878 Bytes
Versions: 21
Compression:
Stored size: 878 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.aquire(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.aquire(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
21 entries across 21 versions & 1 rubygems