Class: Kuhsaft::Cms::BricksController
- Inherits:
-
AdminController
- Object
- ActionController::Base
- ApplicationController
- AdminController
- Kuhsaft::Cms::BricksController
- Defined in:
- app/controllers/kuhsaft/cms/bricks_controller.rb
Instance Method Summary collapse
Methods inherited from AdminController
Instance Method Details
#create ⇒ Object
7 8 9 10 |
# File 'app/controllers/kuhsaft/cms/bricks_controller.rb', line 7 def create @brick = params[:brick][:type].constantize.new(params[:brick]) @brick.save(:validate => false) end |
#destroy ⇒ Object
27 28 29 30 31 |
# File 'app/controllers/kuhsaft/cms/bricks_controller.rb', line 27 def destroy @brick = Kuhsaft::Brick.find(params[:id]) @parent_brick = @brick.brick_list @brick.destroy end |
#update ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'app/controllers/kuhsaft/cms/bricks_controller.rb', line 12 def update @brick = Kuhsaft::Brick.find(params[:id]) @brick.update_attributes(params[:brick]) # # rails will fall back to html if ajax can't be used # this is the case with the image brick, because ajax does not # support image uploads # respond_with @brick do |format| format.js format.html { redirect_to edit_cms_page_path(@brick.parents.first) } end end |