Class: Workarea::Admin::ContentBlogsController
- Inherits:
-
Admin::ApplicationController
- Object
- Admin::ApplicationController
- Workarea::Admin::ContentBlogsController
- Defined in:
- app/controllers/workarea/admin/content_blogs_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'app/controllers/workarea/admin/content_blogs_controller.rb', line 16 def create if @blog.save flash[:success] = 'Blog has been created' redirect_to edit_content_blog_path(@blog) else render :new end end |
#destroy ⇒ Object
34 35 36 37 38 |
# File 'app/controllers/workarea/admin/content_blogs_controller.rb', line 34 def destroy @blog.destroy flash[:success] = 'This blog has been removed' redirect_to content_blogs_path end |
#index ⇒ Object
7 8 9 10 11 12 |
# File 'app/controllers/workarea/admin/content_blogs_controller.rb', line 7 def index search = Search::AdminBlogs.new( params.merge(autocomplete: request.xhr?) ) @search = BlogSearchViewModel.new(search, params) end |
#show ⇒ Object
14 |
# File 'app/controllers/workarea/admin/content_blogs_controller.rb', line 14 def show; end |
#update ⇒ Object
25 26 27 28 29 30 31 32 |
# File 'app/controllers/workarea/admin/content_blogs_controller.rb', line 25 def update if @blog.update_attributes(blog_params) flash[:success] = 'Blog has been updated' redirect_to edit_content_blog_path(@blog) else render :edit end end |