Class: ManifestationCustomPropertiesController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/manifestation_custom_properties_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject

POST /manifestation_custom_properties



24
25
26
27
28
29
30
31
32
# File 'app/controllers/manifestation_custom_properties_controller.rb', line 24

def create
  @manifestation_custom_property = ManifestationCustomProperty.new(manifestation_custom_property_params)

  if @manifestation_custom_property.save
    redirect_to @manifestation_custom_property, notice: t('controller.successfully_created', model: t('activerecord.models.manifestation_custom_property'))
  else
    render :new
  end
end

#destroyObject

DELETE /manifestation_custom_properties/1



49
50
51
52
# File 'app/controllers/manifestation_custom_properties_controller.rb', line 49

def destroy
  @manifestation_custom_property.destroy
  redirect_to manifestation_custom_properties_url, notice: t('controller.successfully_deleted', model: t('activerecord.models.manifestation_custom_property'))
end

#editObject

GET /manifestation_custom_properties/1/edit



20
21
# File 'app/controllers/manifestation_custom_properties_controller.rb', line 20

def edit
end

#indexObject

GET /manifestation_custom_properties



6
7
8
# File 'app/controllers/manifestation_custom_properties_controller.rb', line 6

def index
  @manifestation_custom_properties = ManifestationCustomProperty.order(:position)
end

#newObject

GET /manifestation_custom_properties/new



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

def new
  @manifestation_custom_property = ManifestationCustomProperty.new
end

#showObject

GET /manifestation_custom_properties/1



11
12
# File 'app/controllers/manifestation_custom_properties_controller.rb', line 11

def show
end

#updateObject

PATCH/PUT /manifestation_custom_properties/1



35
36
37
38
39
40
41
42
43
44
45
46
# File 'app/controllers/manifestation_custom_properties_controller.rb', line 35

def update
  if params[:move]
    move_position(@manifestation_custom_property, params[:move])
    return
  end

  if @manifestation_custom_property.update(manifestation_custom_property_params)
    redirect_to @manifestation_custom_property, notice: t('controller.successfully_updated', model: t('activerecord.models.manifestation_custom_property'))
  else
    render :edit
  end
end