Class: Wechat::Admin::WechatConfigsController
- Inherits:
-
BaseController
- Object
- BaseController
- Wechat::Admin::WechatConfigsController
- Defined in:
- app/controllers/wechat/admin/wechat_configs_controller.rb
Instance Method Summary collapse
- #create ⇒ Object
- #destroy ⇒ Object
- #edit ⇒ Object
- #index ⇒ Object
- #new ⇒ Object
- #show ⇒ Object
- #update ⇒ Object
Instance Method Details
#create ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'app/controllers/wechat/admin/wechat_configs_controller.rb', line 12 def create @wechat_config = WechatConfig.new(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 :new } format.html { render :new } format.js { redirect_back fallback_location: admin_wechat_configs_url } format.json { render :show } end end end |
#destroy ⇒ Object
54 55 56 57 |
# File 'app/controllers/wechat/admin/wechat_configs_controller.rb', line 54 def destroy @wechat_config.destroy redirect_to admin_wechat_configs_url end |
#edit ⇒ Object
33 34 |
# File 'app/controllers/wechat/admin/wechat_configs_controller.rb', line 33 def edit end |
#index ⇒ Object
4 5 6 |
# File 'app/controllers/wechat/admin/wechat_configs_controller.rb', line 4 def index @wechat_configs = WechatConfig.page(params[:page]) end |
#new ⇒ Object
8 9 10 |
# File 'app/controllers/wechat/admin/wechat_configs_controller.rb', line 8 def new @wechat_config = WechatConfig.new end |
#show ⇒ Object
30 31 |
# File 'app/controllers/wechat/admin/wechat_configs_controller.rb', line 30 def show end |
#update ⇒ Object
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'app/controllers/wechat/admin/wechat_configs_controller.rb', line 36 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 |