Sha256: 142320d6633975e2115fb6d031dd1be3cfd77474ccbfcdf538a4a490f4dfddda

Contents?: true

Size: 966 Bytes

Versions: 28

Compression:

Stored size: 966 Bytes

Contents

require_dependency "smithy/base_controller"

module Smithy
  class ContentsController < BaseController
    respond_to :html, :json

    def show
      @content = Smithy::Content.find(params[:id])
      respond_with @content
    end

    def new
      @content = Smithy::Content.new(filtered_params)
      respond_with @content
    end

    def create
      @content = Smithy::Content.new(filtered_params)
      @content.save
      flash.notice = "Your content was created" if @content.persisted?
      respond_with @content
    end

    def edit
      @content = Smithy::Content.find(params[:id])
      respond_with @content
    end

    def update
      @content = Smithy::Content.find(params[:id])
      flash.notice = "Your content was saved" if @content.update_attributes(filtered_params)
      respond_with @content
    end

    def destroy
      @content = Smithy::Content.find(params[:id])
      @content.destroy
      respond_with @content
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

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