Class: EricWeixin::Cms::Weixin::TwoDimensionCodesController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/eric_weixin/cms/weixin/two_dimension_codes_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



11
12
13
14
15
16
17
18
19
20
# File 'app/controllers/eric_weixin/cms/weixin/two_dimension_codes_controller.rb', line 11

def create
	begin
    @two_dimension_code = ::EricWeixin::TwoDimensionCode.get_long_time_two_dimension_code(two_dimension_code_params)
    redirect_to cms_weixin_two_dimension_code_path(@two_dimension_code.id)
  rescue Exception => e
    dispose_exception e
    message = get_notice_str
    redirect_to new_cms_weixin_two_dimension_code_path
  end
end

#indexObject

before_action :set_weixin_article_data, only: [:show, :edit, :update, :destroy]



3
4
5
# File 'app/controllers/eric_weixin/cms/weixin/two_dimension_codes_controller.rb', line 3

def index
	@two_dimension_codes = ::EricWeixin::TwoDimensionCode.where("action_info <> ?", '')
end

#newObject



22
23
24
25
# File 'app/controllers/eric_weixin/cms/weixin/two_dimension_codes_controller.rb', line 22

def new
	@two_dimension_code = ::EricWeixin::TwoDimensionCode.new
	@public_accounts = ::EricWeixin::PublicAccount.all
end

#showObject



7
8
9
# File 'app/controllers/eric_weixin/cms/weixin/two_dimension_codes_controller.rb', line 7

def show
	@two_dimension_code = ::EricWeixin::TwoDimensionCode.find(params[:id])
end