Sha256: 5926cfca2177e96a39bab5902776a7109b34e047e1efee81eeba4d90c8a7e25c

Contents?: true

Size: 1.28 KB

Versions: 28

Compression:

Stored size: 1.28 KB

Contents

require_dependency "smithy/base_controller"

module Smithy
  class ContentBlocksController < BaseController
    before_filter :load_content_blocks
    respond_to :html, :json

    def index
      respond_with @content_blocks
    end

    def new
      @content_block = ContentBlock.new(filtered_params)
      respond_with @content_block
    end

    def create
      @content_block = ContentBlock.new(filtered_params)
      @content_block.save
      flash.notice = "Your content_block was created" if @content_block.persisted?
      respond_with @content_block do |format|
        format.html { redirect_to [:edit, @content_block] }
      end
    end

    def edit
      @content_block = ContentBlock.find(params[:id])
      respond_with @content_block
    end

    def update
      @content_block = ContentBlock.find(params[:id])
      flash.notice = "Your content_block was saved" if @content_block.update_attributes(filtered_params)
      respond_with @content_block do |format|
        format.html { redirect_to [:edit, @content_block] }
      end
    end

    def destroy
      @content_block = ContentBlock.find(params[:id])
      @content_block.destroy
      respond_with @content_block
    end

    private
      def load_content_blocks
        @content_blocks = ContentBlock.all
      end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
smithycms-0.8.1 app/controllers/smithy/content_blocks_controller.rb
smithycms-0.7.3 app/controllers/smithy/content_blocks_controller.rb
smithycms-0.7.2 app/controllers/smithy/content_blocks_controller.rb
smithycms-0.7.1 app/controllers/smithy/content_blocks_controller.rb
smithycms-0.7.0 app/controllers/smithy/content_blocks_controller.rb
smithycms-0.6.10 app/controllers/smithy/content_blocks_controller.rb
smithycms-0.5.99.3 app/controllers/smithy/content_blocks_controller.rb
smithycms-0.6.9 app/controllers/smithy/content_blocks_controller.rb
smithycms-0.6.7 app/controllers/smithy/content_blocks_controller.rb
smithycms-0.6.6 app/controllers/smithy/content_blocks_controller.rb
smithycms-0.6.5 app/controllers/smithy/content_blocks_controller.rb
smithycms-0.6.4 app/controllers/smithy/content_blocks_controller.rb
smithycms-0.6.3 app/controllers/smithy/content_blocks_controller.rb
smithycms-0.5.99.2 app/controllers/smithy/content_blocks_controller.rb
smithycms-0.5.99.1 app/controllers/smithy/content_blocks_controller.rb
smithycms-0.5.99 app/controllers/smithy/content_blocks_controller.rb
smithycms-0.6.2 app/controllers/smithy/content_blocks_controller.rb
smithycms-0.6.1 app/controllers/smithy/content_blocks_controller.rb
smithycms-0.5.2 app/controllers/smithy/content_blocks_controller.rb
smithycms-0.6.0 app/controllers/smithy/content_blocks_controller.rb