Class: Miniblog::Admin::TransitionsController

Inherits:
BaseController show all
Defined in:
app/controllers/miniblog/admin/transitions_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

#createObject



6
7
8
9
10
11
12
# File 'app/controllers/miniblog/admin/transitions_controller.rb', line 6

def create
  namespace = '_as_publisher' if current_user.is_publisher?
  @post.send "#{params[:transition]}#{namespace}"
  status = @post.status_change_records.build(user: current_user, state: params[:transition])
  status.save
  redirect_to admin_posts_path
end