add weixin controler for verify weixin

This commit is contained in:
2013-04-16 23:17:18 +08:00
parent ad0145abad
commit f910b0baef
7 changed files with 39 additions and 0 deletions
+3
View File
@@ -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/
+3
View File
@@ -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/
+7
View File
@@ -0,0 +1,7 @@
class WeiXinController < ApplicationController
def verify
echo_str = params[:echostr]
render text:echo_str
end
end
+2
View File
@@ -0,0 +1,2 @@
module WeiXinHelper
end
+4
View File
@@ -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.
@@ -0,0 +1,5 @@
require 'spec_helper'
describe WeiXinController do
end
+15
View File
@@ -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