fix next line and carriage

This commit is contained in:
rulingcom 2025-07-31 22:56:22 +08:00
parent 5c143daab1
commit d7882b83d6
5 changed files with 4 additions and 5 deletions

View File

@ -364,7 +364,6 @@ class Admin::AsksController < OrbitAdminController
def update
locale = I18n.locale
temp_params = params.require(:ask_question).permit!
all_to_save = []
ask_setting = AskCategorySetting.where(category_id: params['ask_question']['category_id']).first
if ask_setting.nil?

View File

@ -492,7 +492,7 @@ class AsksController < ApplicationController
acknowledgement = AskAcknowledgement.where(:category_id => params['category']).first rescue nil
content = acknowledgement.nil? ? t('ask.thank_text') : acknowledgement.content
{
"content" => content #[I18n.locale]
"content" => content[I18n.locale]
}
end

View File

@ -307,7 +307,7 @@ module Admin::AsksHelper
end
end
when 'text_area'
readonly ? value : text_area_tag(field_name,value,{:required => v['required']=='true',:placeholder=> v['prompt_word'][I18n.locale],:title=> v['prompt_word'][I18n.locale],:class=>'ckeditor'})
readonly ? value.to_s.gsub("\n", "<br/>").gsub("\r", "").html_safe : text_area_tag(field_name,value,{:required => v['required']=='true',:placeholder=> v['prompt_word'][I18n.locale],:title=> v['prompt_word'][I18n.locale],:class=>'ckeditor'})
when 'radio_button'
options_hash = Hash(v['options'])
if lock

View File

@ -95,7 +95,7 @@
end
%>
<th><%= trans %></th>
<td><%= val %></td>
<td><%= val.to_s.gsub("\n", "<br/>").gsub("\r", "").html_safe %></td>
</tr>
<% end %>
<% else %>

View File

@ -5,7 +5,7 @@
</head>
<body>
<p>
<%= @data['validation_email_content'].to_s.gsub(/[(\n)(\r)]/, "\n" => "<br/>", "\r" => "" ).html_safe %>
<%= @data['validation_email_content'].to_s.gsub("\n", "<br/>").gsub("\r", "").html_safe %>
</p>
<br />
<% if @data['referer_link'] %>