<% question = AskQuestion.find(@data['ask_question_id']) rescue nil %> <% if question %> <% yes_trans = t('ask.yes') no_trans = t('ask.no') locale = I18n.locale.to_s %> <% @data['disp_fields_infos'].each do |f, field_info| %> <% next if f == 'recaptcha' %> <% trans = field_info["trans"] is_cat = false is_custom = false if f.include?("@") f = field_info["key"] is_custom = true elsif f == 'ask_category_id' f = 'category_id' is_cat = true end val = question[f] if val == true || val == false val = val ? yes_trans : no_trans else val = question.custom_values[f] if is_custom type = field_info["type"] if ["select", "radio_button", "checkbox"].include?(type) if type == "checkbox" val = val.values rescue [] else val = Array(val) end val = val.map{|v| field_info["options"][v][locale] rescue ""}.join("
").html_safe elsif ["file", "image"].include?(type) if val.present? val = "#{val[0]}".html_safe end elsif type == "date" val = val["datetime"].values[0].values rescue [] if val.count == 2 val = val[0].gsub('-', '/') + " ~ " + val[1].gsub('-', '/') else val = val[0].gsub('-', '/') end elsif type == "instructions" val = field_info["instructions"][locale].to_s.html_safe rescue "" else if is_cat val = Category.find(val).title rescue '' elsif f == 'usage_rule' val = @data['usage_rule'].to_s.html_safe elsif f == 'appointment' val = question.appointment.strftime('%Y/%m/%d %H:%M') rescue "" else val = val.to_s.html_safe end end end %> <% end %> <% else %> <% end %>
<%= trans %> <%= val %>
<%= AskQuestion.human_attribute_name(:name) %>: <%= @data['name'] %>
<%= AskQuestion.human_attribute_name(:mail) %>: <%= @data['mail'] %>
<%= AskQuestion.human_attribute_name(:phone) %>: <%= @data['phone'] %>
<%= AskQuestion.human_attribute_name(:name) %>: <%= @data['name'].to_s.gsub(/[(\n)(\r)]/, "\n" => "
", "\r" => "" ).html_safe %>

此為系統自動發信,請勿直接回覆