Class: Admin::ResponsesController
- Inherits:
-
BaseController
- Object
- BaseController
- Admin::ResponsesController
- Defined in:
- app/controllers/wechat/admin/responses_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
20 21 22 23 24 25 26 |
# File 'app/controllers/wechat/admin/responses_controller.rb', line 20 def create @response = @app.responses.build(response_params) unless @response.save render :new, locals: { model: @response }, status: :unprocessable_entity end end |
#edit_reply ⇒ Object
28 29 30 31 32 33 34 35 |
# File 'app/controllers/wechat/admin/responses_controller.rb', line 28 def edit_reply q_params = { appid: @app.appid } q_params.merge! type: @response.reply.type if @response.reply @replies = Reply.where(q_params) end |
#filter_reply ⇒ Object
37 38 |
# File 'app/controllers/wechat/admin/responses_controller.rb', line 37 def filter_reply end |
#index ⇒ Object
7 8 9 10 11 12 13 14 |
# File 'app/controllers/wechat/admin/responses_controller.rb', line 7 def index q_params = { type: ['TextResponse', 'PersistScanResponse', 'EventResponse'] } q_params.merge! params.permit(:type) @responses = @app.responses.default_where(q_params).order(id: :desc).page(params[:page]) end |
#new ⇒ Object
16 17 18 |
# File 'app/controllers/wechat/admin/responses_controller.rb', line 16 def new @response = @app.responses.build end |