Class: ItemCustomPropertiesController

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

Instance Method Summary collapse

Instance Method Details

#createObject

POST /item_custom_properties



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

def create
  @item_custom_property = ItemCustomProperty.new(item_custom_property_params)

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

#destroyObject

DELETE /item_custom_properties/1



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

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

#editObject

GET /item_custom_properties/1/edit



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

def edit
end

#indexObject

GET /item_custom_properties



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

def index
  @item_custom_properties = ItemCustomProperty.order(:position)
end

#newObject

GET /item_custom_properties/new



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

def new
  @item_custom_property = ItemCustomProperty.new
end

#showObject

GET /item_custom_properties/1



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

def show
end

#updateObject

PATCH/PUT /item_custom_properties/1



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

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

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