Class: Crowdblog::Admin::TransitionsController
- Inherits:
-
BaseController
- Object
- ApplicationController
- Crowdblog::ApplicationController
- BaseController
- Crowdblog::Admin::TransitionsController
- Defined in:
- app/controllers/crowdblog/admin/transitions_controller.rb
Instance Method Summary collapse
Methods inherited from Crowdblog::ApplicationController
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Crowdblog::ApplicationController
Instance Method Details
#create ⇒ Object
7 8 9 10 11 12 13 |
# File 'app/controllers/crowdblog/admin/transitions_controller.rb', line 7 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 respond_with @post, location: admin_post_url(@post) end |