app/controllers/admin/clipboard_controller.rb in alchemy_cms-2.0.rc3 vs app/controllers/admin/clipboard_controller.rb in alchemy_cms-2.0.rc4

- old
+ new

@@ -5,35 +5,34 @@ before_filter :set_translation def index clipboard = get_clipboard(params[:remarkable_type].tableize) @clipboard_items = params[:remarkable_type].classify.constantize.all_from_clipboard(clipboard) - render :layout => false + respond_to do |format| + format.html { render :layout => false } + end end def insert @clipboard = get_clipboard(params[:remarkable_type].tableize) @item = params[:remarkable_type].classify.constantize.find(params[:remarkable_id]) unless @clipboard.include?(params[:remarkable_id]) @clipboard.push(params[:remarkable_id]) end - if params[:remove] == 'true' - case params[:remarkable_type] - when 'element' then - @item.page = nil - @item.position = nil - when 'page' then #TODO: page.move feature - end - @item.save(false) + respond_to do |format| + format.js end rescue Exception => e exception_handler(e) end def remove @clipboard = get_clipboard(params[:remarkable_type].tableize) @item = params[:remarkable_type].classify.constantize.find(params[:remarkable_id]) @clipboard.delete(params[:remarkable_id]) + respond_to do |format| + format.js + end rescue Exception => e exception_handler(e) end def clear