From ffff41153c1c901f3d474b86b08fb14b569a20db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B1=E5=8D=9A=E4=BA=9E?= Date: Thu, 24 Mar 2022 13:27:55 +0800 Subject: [PATCH] fix error --- app/controllers/asks_controller.rb | 4 +++- app/views/asks/index.html.erb | 6 +----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/app/controllers/asks_controller.rb b/app/controllers/asks_controller.rb index b66bf87..0552a52 100644 --- a/app/controllers/asks_controller.rb +++ b/app/controllers/asks_controller.rb @@ -5,6 +5,7 @@ class AsksController < ApplicationController include ActionView::Helpers::FormOptionsHelper helper ActionView::Helpers::UrlHelper include ActionController::RequestForgeryProtection + include RuCaptcha::ViewHelpers def widget subpart = OrbitHelper.get_current_widget case subpart.widget_type @@ -89,6 +90,7 @@ class AsksController < ApplicationController def initialize super @app_title = 'ask' + self.request = OrbitHelper.request end def show ask_question = AskQuestion.where(id: @params['item']).first @@ -307,7 +309,7 @@ class AsksController < ApplicationController when 'appointment' f1['content'] = "
#{text_field_tag(field_name,nil,placeholder:@default_ask_setting.field_name("#{field}"))}
" when 'recaptcha' - f1['content'] = "{{gotcha_error}}{{gotcha}}" + f1['content'] = "#{gotcha_error}#{gotcha}" when 'usage_rule' next if ask_setting.usage_rule.blank? f1['content'] = ask_setting.usage_rule diff --git a/app/views/asks/index.html.erb b/app/views/asks/index.html.erb index a8cf6ab..e52b37d 100644 --- a/app/views/asks/index.html.erb +++ b/app/views/asks/index.html.erb @@ -99,11 +99,7 @@ <%= javascript_include_tag 'validator' %>
- <% - tmp_gotcha_error = gotcha_error - tmp_gotcha = gotcha - %> - <%= @switch_form.gsub("{{gotcha_error}}",tmp_gotcha_error).gsub("{{gotcha}}",tmp_gotcha).html_safe %> + <%= @switch_form.html_safe %>