Module: CardController::Rest

Includes:
ActionController::HttpAuthentication::Token
Included in:
CardController
Defined in:
lib/card_controller/rest.rb

Overview

helper method for RESTful action methods for card

Instance Method Summary collapse

Instance Method Details

#assetObject

Deprecated.


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

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

#createObject



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

def create
  handle { card.save! }
end

#deleteObject



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

def delete
  handle { card.delete! }
end

#readObject



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

def read
  show
end

#updateObject



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

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