Class: Admin::WellKnownsController

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

Defined Under Namespace

Classes: Collection

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#collectionObject (readonly)

Returns the value of attribute collection.



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

def collection
  @collection
end

#well_knownObject (readonly)

Returns the value of attribute well_known.



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

def well_known
  @well_known
end

Instance Method Details

#createObject



29
30
31
32
33
34
35
36
37
# File 'app/controllers/admin/well_knowns_controller.rb', line 29

def create
  @well_known = WellKnown.new(well_known_params)

  if @well_known.save
    redirect_to admin_well_known_path(well_known), status: :see_other
  else
    render :new, locals: { well_known: }, status: :unprocessable_content
  end
end

#destroyObject



47
48
49
50
51
# File 'app/controllers/admin/well_knowns_controller.rb', line 47

def destroy
  @well_known.destroy!

  redirect_to admin_well_knowns_path, status: :see_other
end

#editObject



25
26
27
# File 'app/controllers/admin/well_knowns_controller.rb', line 25

def edit
  render locals: { well_known: }
end

#indexObject



9
10
11
12
13
# File 'app/controllers/admin/well_knowns_controller.rb', line 9

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

  render locals: { collection: }
end

#newObject



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

def new
  @well_known = WellKnown.new

  render locals: { well_known: }
end

#showObject



15
16
17
# File 'app/controllers/admin/well_knowns_controller.rb', line 15

def show
  render locals: { well_known: }
end

#updateObject



39
40
41
42
43
44
45
# File 'app/controllers/admin/well_knowns_controller.rb', line 39

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