Class: Wechat::Panel::WechatConfigsController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/wechat/panel/wechat_configs_controller.rb

Instance Method Summary collapse

Instance Method Details

#destroyObject



30
31
32
33
# File 'app/controllers/wechat/panel/wechat_configs_controller.rb', line 30

def destroy
  @wechat_config.destroy
  redirect_to admin_wechat_configs_url
end

#editObject



8
9
10
# File 'app/controllers/wechat/panel/wechat_configs_controller.rb', line 8

def edit
  @wechat_config = current_organ.wechat_config
end

#showObject



4
5
6
# File 'app/controllers/wechat/panel/wechat_configs_controller.rb', line 4

def show
  @wechat_config = current_organ.wechat_config
end

#updateObject



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'app/controllers/wechat/panel/wechat_configs_controller.rb', line 12

def update
  @wechat_config.assign_attributes(wechat_config_params)

  respond_to do |format|
    if @wechat_config.save
      format.html.phone
      format.html { redirect_to admin_wechat_configs_url }
      format.js { redirect_back fallback_location: admin_wechat_configs_url }
      format.json { render :show }
    else
      format.html.phone { render :edit }
      format.html { render :edit }
      format.js { redirect_back fallback_location: admin_wechat_configs_url }
      format.json { render :show }
    end
  end
end