From d163fd4a5472a122ca5304eeb3d259cd882dd059 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Mon, 5 Aug 2019 16:26:45 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/application_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 024c7c151..7aa89dbd7 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -190,7 +190,7 @@ class ApplicationController < ActionController::Base def check_account if !current_user.profile_completed? info_url = '/account/profile' - tip_exception(402, '') + tip_exception(402, info_url) end end From 662920cd963d13b005ceda8ead14f54b47b9acae Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Tue, 6 Aug 2019 14:58:20 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=B8=96=E5=AD=90=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E5=81=9A=E6=98=AF=E5=90=A6=E5=AE=8C=E5=96=84=E8=B5=84=E6=96=99?= =?UTF-8?q?=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/assets/javascripts/users/banks.js | 2 ++ app/assets/stylesheets/users/banks.scss | 3 +++ app/controllers/memos_controller.rb | 1 + app/controllers/users/banks_controller.rb | 8 ++++++++ app/helpers/users/banks_helper.rb | 2 ++ spec/controllers/users/banks_controller_spec.rb | 5 +++++ spec/helpers/users/banks_helper_spec.rb | 15 +++++++++++++++ 7 files changed, 36 insertions(+) create mode 100644 app/assets/javascripts/users/banks.js create mode 100644 app/assets/stylesheets/users/banks.scss create mode 100644 app/controllers/users/banks_controller.rb create mode 100644 app/helpers/users/banks_helper.rb create mode 100644 spec/controllers/users/banks_controller_spec.rb create mode 100644 spec/helpers/users/banks_helper_spec.rb diff --git a/app/assets/javascripts/users/banks.js b/app/assets/javascripts/users/banks.js new file mode 100644 index 000000000..dee720fac --- /dev/null +++ b/app/assets/javascripts/users/banks.js @@ -0,0 +1,2 @@ +// Place all the behaviors and hooks related to the matching controller here. +// All this logic will automatically be available in application.js. diff --git a/app/assets/stylesheets/users/banks.scss b/app/assets/stylesheets/users/banks.scss new file mode 100644 index 000000000..6f7c19148 --- /dev/null +++ b/app/assets/stylesheets/users/banks.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the users/banks 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/memos_controller.rb b/app/controllers/memos_controller.rb index 7bb36a8a0..ac60f9f41 100644 --- a/app/controllers/memos_controller.rb +++ b/app/controllers/memos_controller.rb @@ -1,5 +1,6 @@ class MemosController < ApplicationController before_action :require_login, except: [:show, :index] + before_action :check_account, only: [:new, :create, :reply] before_action :set_memo, only: [:show, :edit, :update, :destroy, :sticky_or_cancel, :hidden, :more_reply] before_action :validate_memo_params, only: [:create, :update] before_action :owner_or_admin, only: [:edit, :update, :destroy] diff --git a/app/controllers/users/banks_controller.rb b/app/controllers/users/banks_controller.rb new file mode 100644 index 000000000..c9a6a8c48 --- /dev/null +++ b/app/controllers/users/banks_controller.rb @@ -0,0 +1,8 @@ +class Users::BanksController < Users::BaseController + def index + + end + + private + +end diff --git a/app/helpers/users/banks_helper.rb b/app/helpers/users/banks_helper.rb new file mode 100644 index 000000000..c57477794 --- /dev/null +++ b/app/helpers/users/banks_helper.rb @@ -0,0 +1,2 @@ +module Users::BanksHelper +end diff --git a/spec/controllers/users/banks_controller_spec.rb b/spec/controllers/users/banks_controller_spec.rb new file mode 100644 index 000000000..80abbaddc --- /dev/null +++ b/spec/controllers/users/banks_controller_spec.rb @@ -0,0 +1,5 @@ +require 'rails_helper' + +RSpec.describe Users::BanksController, type: :controller do + +end diff --git a/spec/helpers/users/banks_helper_spec.rb b/spec/helpers/users/banks_helper_spec.rb new file mode 100644 index 000000000..3148e62e9 --- /dev/null +++ b/spec/helpers/users/banks_helper_spec.rb @@ -0,0 +1,15 @@ +require 'rails_helper' + +# Specs in this file have access to a helper object that includes +# the Users::BanksHelper. For example: +# +# describe Users::BanksHelper do +# describe "string concat" do +# it "concats two strings with spaces" do +# expect(helper.concat_strings("this","that")).to eq("this that") +# end +# end +# end +RSpec.describe Users::BanksHelper, type: :helper do + pending "add some examples to (or delete) #{__FILE__}" +end From 291c2fa674de5124434f3a6fb03c54ced111a377 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Tue, 6 Aug 2019 15:09:05 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=B8=96=E5=AD=90=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E5=81=9A=E6=98=AF=E5=90=A6=E5=AE=8C=E5=96=84=E8=B5=84=E6=96=99?= =?UTF-8?q?=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/memos_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/memos_controller.rb b/app/controllers/memos_controller.rb index ac60f9f41..88139fe7e 100644 --- a/app/controllers/memos_controller.rb +++ b/app/controllers/memos_controller.rb @@ -1,6 +1,6 @@ class MemosController < ApplicationController before_action :require_login, except: [:show, :index] - before_action :check_account, only: [:new, :create, :reply] + before_action :check_account, only: [:new, :create] before_action :set_memo, only: [:show, :edit, :update, :destroy, :sticky_or_cancel, :hidden, :more_reply] before_action :validate_memo_params, only: [:create, :update] before_action :owner_or_admin, only: [:edit, :update, :destroy]