Class: Admin::WellKnownsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/admin/well_knowns_controller.rb

Defined Under Namespace

Classes: Collection

Instance Method Summary collapse

Instance Method Details

#createObject



25
26
27
28
29
30
31
32
33
# File 'app/controllers/admin/well_knowns_controller.rb', line 25

def create
  @well_known = ::WellKnown.new(well_known_params)

  if @well_known.save
    redirect_to [:admin, @well_known], status: :see_other
  else
    render :new, locals: { well_known: @well_known }, status: :unprocessable_content
  end
end

#destroyObject



43
44
45
46
47
# File 'app/controllers/admin/well_knowns_controller.rb', line 43

def destroy
  @well_known.destroy!

  redirect_to action: :index, status: :see_other
end

#editObject



21
22
23
# File 'app/controllers/admin/well_knowns_controller.rb', line 21

def edit
  render locals: { well_known: @well_known }
end

#indexObject



7
8
9
10
11
# File 'app/controllers/admin/well_knowns_controller.rb', line 7

def index
  collection = Collection.new.with_params(params).apply(::WellKnown.strict_loading.all)

  render locals: { collection: }
end

#newObject



17
18
19
# File 'app/controllers/admin/well_knowns_controller.rb', line 17

def new
  render locals: { well_known: ::WellKnown.new }
end

#showObject



13
14
15
# File 'app/controllers/admin/well_knowns_controller.rb', line 13

def show
  render locals: { well_known: @well_known }
end

#updateObject



35
36
37
38
39
40
41
# File 'app/controllers/admin/well_knowns_controller.rb', line 35

def update
  if @well_known.update(well_known_params)
    redirect_to action: :show, status: :see_other
  else
    render :edit, locals: { well_known: @well_known }, status: :unprocessable_content
  end
end