Class: Share::ScenesController
- Inherits:
-
BaseController
- Object
- BaseController
- Share::ScenesController
- Defined in:
- app/controllers/wechat/share/scenes_controller.rb
Instance Method Summary collapse
- #create ⇒ Object
- #destroy ⇒ Object
- #edit ⇒ Object
- #index ⇒ Object
- #new ⇒ Object
- #show ⇒ Object
- #sync ⇒ Object
- #update ⇒ Object
Instance Method Details
#create ⇒ Object
17 18 19 20 21 22 23 |
# File 'app/controllers/wechat/share/scenes_controller.rb', line 17 def create @scene = @app.scenes.build(scene_params) unless @scene.save render :new, locals: { model: @scene }, status: :unprocessable_entity end end |
#destroy ⇒ Object
44 45 46 |
# File 'app/controllers/wechat/share/scenes_controller.rb', line 44 def destroy @scene.destroy end |
#edit ⇒ Object
28 29 |
# File 'app/controllers/wechat/share/scenes_controller.rb', line 28 def edit end |
#index ⇒ Object
6 7 8 9 10 11 |
# File 'app/controllers/wechat/share/scenes_controller.rb', line 6 def index q_params = {} q_params.merge! default_params @scenes = @app.scenes.default_where(q_params).order(id: :desc).page(params[:page]) end |
#new ⇒ Object
13 14 15 |
# File 'app/controllers/wechat/share/scenes_controller.rb', line 13 def new @scene = @app.scenes.build end |
#show ⇒ Object
25 26 |
# File 'app/controllers/wechat/share/scenes_controller.rb', line 25 def show end |
#sync ⇒ Object
39 40 41 42 |
# File 'app/controllers/wechat/share/scenes_controller.rb', line 39 def sync r= @app.api. @app. render 'sync', locals: { notice: r.to_s } end |
#update ⇒ Object
31 32 33 34 35 36 37 |
# File 'app/controllers/wechat/share/scenes_controller.rb', line 31 def update @scene.assign_attributes(scene_params) unless @scene.save render :edit, locals: { model: @scene }, status: :unprocessable_entity end end |