diff --git a/app/assets/javascripts/wei_xin.js.coffee b/app/assets/javascripts/wei_xin.js.coffee new file mode 100644 index 0000000..7615679 --- /dev/null +++ b/app/assets/javascripts/wei_xin.js.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/ diff --git a/app/assets/stylesheets/wei_xin.css.scss b/app/assets/stylesheets/wei_xin.css.scss new file mode 100644 index 0000000..a4012be --- /dev/null +++ b/app/assets/stylesheets/wei_xin.css.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the wei_xin controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/controllers/wei_xin_controller.rb b/app/controllers/wei_xin_controller.rb new file mode 100644 index 0000000..7e8df2b --- /dev/null +++ b/app/controllers/wei_xin_controller.rb @@ -0,0 +1,7 @@ +class WeiXinController < ApplicationController + + def verify + echo_str = params[:echostr] + render text:echo_str + end +end diff --git a/app/helpers/wei_xin_helper.rb b/app/helpers/wei_xin_helper.rb new file mode 100644 index 0000000..beeea35 --- /dev/null +++ b/app/helpers/wei_xin_helper.rb @@ -0,0 +1,2 @@ +module WeiXinHelper +end diff --git a/config/routes.rb b/config/routes.rb index 726785a..43b4ad0 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -39,6 +39,10 @@ Libr::Application.routes.draw do post 'api/books/borrow' =>'api#borrow_book' + #for weixin + get 'wx/verify' =>'wei_xin#verify' + + # The priority is based upon order of creation: # first created -> highest priority. diff --git a/spec/controllers/wei_xin_controller_spec.rb b/spec/controllers/wei_xin_controller_spec.rb new file mode 100644 index 0000000..745d28b --- /dev/null +++ b/spec/controllers/wei_xin_controller_spec.rb @@ -0,0 +1,5 @@ +require 'spec_helper' + +describe WeiXinController do + +end diff --git a/spec/helpers/wei_xin_helper_spec.rb b/spec/helpers/wei_xin_helper_spec.rb new file mode 100644 index 0000000..9b4f7d1 --- /dev/null +++ b/spec/helpers/wei_xin_helper_spec.rb @@ -0,0 +1,15 @@ +require 'spec_helper' + +# Specs in this file have access to a helper object that includes +# the WeiXinHelper. For example: +# +# describe WeiXinHelper do +# describe "string concat" do +# it "concats two strings with spaces" do +# helper.concat_strings("this","that").should == "this that" +# end +# end +# end +describe WeiXinHelper do + pending "add some examples to (or delete) #{__FILE__}" +end