Class: EricWeixin::Cms::Weixin::ReplyMessageRulesController
- Inherits:
-
BaseController
- Object
- BaseController
- EricWeixin::Cms::Weixin::ReplyMessageRulesController
- Defined in:
- app/controllers/eric_weixin/cms/weixin/reply_message_rules_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'app/controllers/eric_weixin/cms/weixin/reply_message_rules_controller.rb', line 13 def create begin ::EricWeixin::ReplyMessageRule. params flash[:success] = "创建成功。" redirect_to action: :index rescue Exception=>e dispose_exception e flash.now[:alert] = get_notice_str @public_accounts = ::EricWeixin::PublicAccount.all render :new end end |
#destroy ⇒ Object
44 45 46 47 48 |
# File 'app/controllers/eric_weixin/cms/weixin/reply_message_rules_controller.rb', line 44 def destroy rule = ::EricWeixin::ReplyMessageRule.find(params[:id]) @rule_id = rule.id rule.destroy end |
#edit ⇒ Object
26 27 28 29 |
# File 'app/controllers/eric_weixin/cms/weixin/reply_message_rules_controller.rb', line 26 def edit @rule = ::EricWeixin::ReplyMessageRule.find(params[:id]) @public_accounts = ::EricWeixin::PublicAccount.all end |
#index ⇒ Object
4 5 6 7 |
# File 'app/controllers/eric_weixin/cms/weixin/reply_message_rules_controller.rb', line 4 def index @reply_message_rules = ::EricWeixin::ReplyMessageRule.valid.paginate(page: params[:page], per_page:params[:per_page]||10) @public_accounts = ::EricWeixin::PublicAccount.all end |
#new ⇒ Object
9 10 11 |
# File 'app/controllers/eric_weixin/cms/weixin/reply_message_rules_controller.rb', line 9 def new @public_accounts = ::EricWeixin::PublicAccount.all end |
#update ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'app/controllers/eric_weixin/cms/weixin/reply_message_rules_controller.rb', line 31 def update begin @reply_message_rule = ::EricWeixin::ReplyMessageRule.(params[:id],params) flash[:success] = "更新成功。" redirect_to action: :index rescue Exception=> e dispose_exception e flash.now[:alert] = get_notice_str @public_accounts = ::EricWeixin::PublicAccount.all render :edit end end |