Module: CardController::Rest

Included in:
CardController
Defined in:
decko/lib/card_controller/rest.rb

Overview

RESTful action methods for card

Instance Method Summary collapse

Instance Method Details

#assetObject

Deprecated.


24
25
26
27
28
# File 'decko/lib/card_controller/rest.rb', line 24

def asset
  body = "Decko installation error: missing asset symlinks"
  Rails.logger.info "#{body}.\n  >>> Try `rake decko:update_assets_symlink`"
  render body: body, status: 404
end

#createObject

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PUBLIC METHODS



7
8
9
# File 'decko/lib/card_controller/rest.rb', line 7

def create
  handle { card.save! }
end

#deleteObject



19
20
21
# File 'decko/lib/card_controller/rest.rb', line 19

def delete
  handle { card.delete! }
end

#readObject



11
12
13
# File 'decko/lib/card_controller/rest.rb', line 11

def read
  show
end

#updateObject



15
16
17
# File 'decko/lib/card_controller/rest.rb', line 15

def update
  card.new_card? ? create : handle { card.update! params[:card]&.to_unsafe_h }
end