app/controllers/admin/layouts_controller.rb in locomotive_cms-0.0.2.9 vs app/controllers/admin/layouts_controller.rb in locomotive_cms-0.0.3.1

- old
+ new

@@ -1,57 +1,13 @@ module Admin class LayoutsController < BaseController sections 'settings' + respond_to :json, :only => :update + def index @layouts = current_site.layouts.order_by([[:name, :asc]]) - end - - def new - @layout = current_site.layouts.build - end - - def edit - @layout = current_site.layouts.find(params[:id]) - end - - def create - @layout = current_site.layouts.build(params[:layout]) - - if @layout.save - flash_success! - redirect_to edit_admin_layout_url(@layout) - else - logger.debug "===> #{@layout.errors.inspect}" - flash_error! - render :action => 'new' - end - end - - def update - @layout = current_site.layouts.find(params[:id]) - - if @layout.update_attributes(params[:layout]) - flash_success! - redirect_to edit_admin_layout_url(@layout) - else - flash_error! - render :action => "edit" - end - end - - def destroy - @layout = current_site.layouts.find(params[:id]) - - begin - @layout.destroy - flash_success! - rescue Exception => e - flash[:error] = e.to_s - end - - redirect_to admin_layouts_url end end end \ No newline at end of file