Class: Annex::BlocksController

Inherits:
ApplicationController show all
Defined in:
app/controllers/annex/blocks_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#annex_authenticate!, #annex_authorize!

Instance Method Details

#createObject

POST /annex/blocks



7
8
9
10
11
12
13
14
15
# File 'app/controllers/annex/blocks_controller.rb', line 7

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