Class: ItemCustomPropertiesController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- ItemCustomPropertiesController
- Defined in:
- app/controllers/item_custom_properties_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
POST /item_custom_properties.
-
#destroy ⇒ Object
DELETE /item_custom_properties/1.
-
#edit ⇒ Object
GET /item_custom_properties/1/edit.
-
#index ⇒ Object
GET /item_custom_properties.
-
#new ⇒ Object
GET /item_custom_properties/new.
-
#show ⇒ Object
GET /item_custom_properties/1.
-
#update ⇒ Object
PATCH/PUT /item_custom_properties/1.
Instance Method Details
#create ⇒ Object
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 |
#destroy ⇒ Object
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 |
#edit ⇒ Object
GET /item_custom_properties/1/edit
20 21 |
# File 'app/controllers/item_custom_properties_controller.rb', line 20 def edit end |
#index ⇒ Object
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 |
#new ⇒ Object
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 |
#show ⇒ Object
GET /item_custom_properties/1
11 12 |
# File 'app/controllers/item_custom_properties_controller.rb', line 11 def show end |
#update ⇒ Object
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 |