Sha256: f3d78690095918bf8e6b3d4df322e0da0d8e201c8cf771fada3fd199d5c4da83

Contents?: true

Size: 867 Bytes

Versions: 11

Compression:

Stored size: 867 Bytes

Contents

module Kuhsaft
  module Cms
    class BricksController < AdminController

      respond_to :html, :js

      def create
        @brick = params[:brick][:type].constantize.new(params[:brick])
        @brick.save(:validate => false)
      end

      def update
        @brick = Kuhsaft::Brick.find(params[:id])
        @brick.update_attributes(params[:brick])

        #
        # rails will fall back to html if ajax can't be used
        # this is the case with the image brick, because ajax does not
        # support image uploads
        #
        respond_with @brick do |format|
          format.js
          format.html { redirect_to edit_cms_page_path(@brick.parents.first) }
        end
      end

      def destroy
        @brick = Kuhsaft::Brick.find(params[:id])
        @parent_brick = @brick.brick_list
        @brick.destroy
      end

    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
kuhsaft-1.2.4 app/controllers/kuhsaft/cms/bricks_controller.rb
kuhsaft-1.2.3 app/controllers/kuhsaft/cms/bricks_controller.rb
kuhsaft-1.2.2 app/controllers/kuhsaft/cms/bricks_controller.rb
kuhsaft-1.2.1 app/controllers/kuhsaft/cms/bricks_controller.rb
kuhsaft-1.2.0 app/controllers/kuhsaft/cms/bricks_controller.rb
kuhsaft-1.1.1 app/controllers/kuhsaft/cms/bricks_controller.rb
kuhsaft-1.1.0 app/controllers/kuhsaft/cms/bricks_controller.rb
kuhsaft-1.0.3 app/controllers/kuhsaft/cms/bricks_controller.rb
kuhsaft-1.0.2 app/controllers/kuhsaft/cms/bricks_controller.rb
kuhsaft-1.0.1 app/controllers/kuhsaft/cms/bricks_controller.rb
kuhsaft-1.0.0 app/controllers/kuhsaft/cms/bricks_controller.rb