From 509d4a3df7e56893c0ca00f9f16564b58d96c853 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Tue, 1 Mar 2016 16:56:37 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=91=E5=AE=9A=E6=8F=90=E4=BA=A4=E6=94=B9?= =?UTF-8?q?=E4=B8=BAajax?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/wechats_controller.rb | 6 +++--- .../base_wechat.html.erb} | 1 + app/views/wechats/login.html.erb | 14 +++++++++++--- public/javascripts/wechat/alert.js | 5 +++++ 4 files changed, 20 insertions(+), 6 deletions(-) rename app/views/{wechats/layout.html.erb => layouts/base_wechat.html.erb} (96%) diff --git a/app/controllers/wechats_controller.rb b/app/controllers/wechats_controller.rb index 1c14aece0..01dd135be 100644 --- a/app/controllers/wechats_controller.rb +++ b/app/controllers/wechats_controller.rb @@ -1,5 +1,5 @@ class WechatsController < ActionController::Base - layout 'wechat/layout' + layout 'base_wechat' wechat_responder @@ -179,9 +179,9 @@ class WechatsController < ActionController::Base uw = UserWechat.find_by_id(params[:state]) uw.user_id = user.id uw.save! - render :text => {status:0, msg: "绑定成功"} + render :text => {status:0, msg: "绑定成功"}.to_json rescue Exception=>e - render :text => {status: -1, msg: e.message} + render :text => {status: -1, msg: e.message}.to_json end end diff --git a/app/views/wechats/layout.html.erb b/app/views/layouts/base_wechat.html.erb similarity index 96% rename from app/views/wechats/layout.html.erb rename to app/views/layouts/base_wechat.html.erb index 8f93ac9a1..729f762ac 100644 --- a/app/views/wechats/layout.html.erb +++ b/app/views/layouts/base_wechat.html.erb @@ -7,6 +7,7 @@