Class: Backend::Content::Rows::ColumnsController
- Inherits:
-
BaseController
- Object
- BaseController
- Backend::Content::Rows::ColumnsController
- Defined in:
- app/controllers/backend/content/rows/columns_controller.rb
Instance Method Summary collapse
Methods included from Concerns::Backend::PositionableController
Instance Method Details
#create ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'app/controllers/backend/content/rows/columns_controller.rb', line 12 def create @column = @row.columns.new allowed_params if @column.save @column.content = @column.content_type.constantize.create! @column.save! redirect_to_edit @column else render :new end end |
#destroy ⇒ Object
33 34 35 36 37 38 |
# File 'app/controllers/backend/content/rows/columns_controller.rb', line 33 def destroy @column.destroy path = "edit_translation_backend_#{@column.row.rowable.class.to_s.underscore}_path" redirect_to send(path, @column.row.rowable, @column.row.locale, anchor: "content-row-#{@column.row.id}") end |
#new ⇒ Object
8 9 10 |
# File 'app/controllers/backend/content/rows/columns_controller.rb', line 8 def new @column = @row.columns.new(@row.column_width_calculator.hashed_values) end |
#update ⇒ Object
25 26 27 28 29 30 31 |
# File 'app/controllers/backend/content/rows/columns_controller.rb', line 25 def update if @column.update_attributes allowed_params render 'backend/lightbox_saved' else render :edit end end |