Class: Cms::DynamicViewsController
- Inherits:
-
BaseController
- Object
- ApplicationController
- ApplicationController
- BaseController
- Cms::DynamicViewsController
- Includes:
- AdminTab
- Defined in:
- app/controllers/cms/dynamic_views_controller.rb
Instance Method Summary collapse
Methods included from AdminTab
Methods inherited from BaseController
Methods inherited from ApplicationController
Instance Method Details
#create ⇒ Object
19 20 21 22 23 24 25 26 27 |
# File 'app/controllers/cms/dynamic_views_controller.rb', line 19 def create @view = dynamic_view_type.new(dynamic_view_params) if @view.save flash[:notice] = "#{dynamic_view_type} '#{@view.name}' was created" redirect_to engine_aware_path(dynamic_view_type) else render :action => "new" end end |
#destroy ⇒ Object
42 43 44 45 46 |
# File 'app/controllers/cms/dynamic_views_controller.rb', line 42 def destroy @view.destroy flash[:notice] = "#{dynamic_view_type} '#{@view.name}' was deleted" redirect_to engine_aware_path(dynamic_view_type) end |
#index ⇒ Object
11 12 13 |
# File 'app/controllers/cms/dynamic_views_controller.rb', line 11 def index @views = dynamic_view_type.paginate(:page => params[:page]).order("name") end |
#new ⇒ Object
15 16 17 |
# File 'app/controllers/cms/dynamic_views_controller.rb', line 15 def new @view = dynamic_view_type.new_with_defaults end |
#show ⇒ Object
29 30 31 |
# File 'app/controllers/cms/dynamic_views_controller.rb', line 29 def show redirect_to [:edit, @view] end |
#update ⇒ Object
33 34 35 36 37 38 39 40 |
# File 'app/controllers/cms/dynamic_views_controller.rb', line 33 def update if @view.update(dynamic_view_params) flash[:notice] = "#{dynamic_view_type} '#{@view.name}' was updated" redirect_to engine_aware_path(dynamic_view_type) else render :action => "edit" end end |