Class: Miniblog::Admin::StatesController

Inherits:
BaseController show all
Defined in:
app/controllers/miniblog/admin/states_controller.rb

Instance Method Summary collapse

Methods inherited from BaseController

#after_post_is_saved

Methods inherited from Miniblog::ApplicationController

#method_missing

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Miniblog::ApplicationController

Instance Method Details

#updateObject



2
3
4
5
6
7
8
9
10
11
12
# File 'app/controllers/miniblog/admin/states_controller.rb', line 2

def update
  @post = Miniblog::Post.find(params[:post_id])
  if @post.published?
    @post.draft
    after_post_is_saved
  else
    @post.publish
    after_post_is_saved
  end
  redirect_to admin_posts_path
end