Module: CafeCar::Controller

Extended by:
ActiveSupport::Concern
Includes:
Authentication, Filtering, Pundit::Authorization
Included in:
ApplicationController, ExamplesController, SessionsController
Defined in:
lib/cafe_car/controller.rb

Defined Under Namespace

Modules: Filtering

Instance Method Summary collapse

Instance Method Details

#createObject



89
90
91
92
# File 'lib/cafe_car/controller.rb', line 89

def create
  run_callbacks(:create) { object.save! }
  respond_with object
end

#destroyObject



99
100
101
102
# File 'lib/cafe_car/controller.rb', line 99

def destroy
  run_callbacks(:destroy) { object.destroy! }
  respond_with object
end

#editObject



87
# File 'lib/cafe_car/controller.rb', line 87

def edit  = respond_with object

#indexObject



84
# File 'lib/cafe_car/controller.rb', line 84

def index = respond_with objects

#newObject



86
# File 'lib/cafe_car/controller.rb', line 86

def new   = respond_with object

#respond_with(*resources, **options, &block) ⇒ Object



104
105
106
# File 'lib/cafe_car/controller.rb', line 104

def respond_with(*resources, **options, &block)
  super(*namespace, *resources, **options, &block)
end

#showObject



85
# File 'lib/cafe_car/controller.rb', line 85

def show  = respond_with object

#updateObject



94
95
96
97
# File 'lib/cafe_car/controller.rb', line 94

def update
  run_callbacks(:update) { object.save! }
  respond_with object
end