Sha256: 6ca38cd9e903009cc241b2172c66c03fa28460a2d9181ed1379c42544739fc34

Contents?: true

Size: 475 Bytes

Versions: 10

Compression:

Stored size: 475 Bytes

Contents

require_dependency "annex/application_controller"

module Annex
  class BlocksController < ApplicationController

    # POST /annex/blocks
    def create
      @block = Block.builder(params)

      if @block.save
        render json: { status: :success }, status: :ok
      else
        render json: @block.errors, status: :unprocessable_entity
      end
    end

    private

      def block_params
        params.require(:user).permit(:route, :content)
      end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
annex-cms-0.5.0 app/controllers/annex/blocks_controller.rb
annex-cms-0.4.0 app/controllers/annex/blocks_controller.rb
annex-cms-0.3.8 app/controllers/annex/blocks_controller.rb
annex-cms-0.3.7 app/controllers/annex/blocks_controller.rb
annex-cms-0.3.6 app/controllers/annex/blocks_controller.rb
annex-cms-0.3.5 app/controllers/annex/blocks_controller.rb
annex-cms-0.3.4 app/controllers/annex/blocks_controller.rb
annex-cms-0.3.2 app/controllers/annex/blocks_controller.rb
annex-cms-0.3.1 app/controllers/annex/blocks_controller.rb
annex-cms-0.3.0 app/controllers/annex/blocks_controller.rb