Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7782187
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T19:27:43+00:00 2026-06-01T19:27:43+00:00

I have a simple form, where a user can write some text and this

  • 0

I have a simple form, where a user can write some text and this text will be send to his email. This process works fine, but I have a problem with the text, that user wrote – in the email is displayed following:

["sadgsdah\r\nsdh\r\ndsf\r\nh\r\nfdhdfhdfh\r\n\r\n\r\n\r\nfdh\r\ndf\r\njh"]

why there are the brackets and the \n and \r chars?

Before than I give the variable with the content into the email template, I tried to do following:

mess_body = params[:contact][:message].to_s.html_safe

But unfortunately this didn’t help me… what I am doing wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T19:27:45+00:00Added an answer on June 1, 2026 at 7:27 pm

    First of all

    mess_body = params[:contact][:message]
    

    returns a array, not a single thing. That is why you get the [” and “] around the output.
    you could get the first element like this:

    mess_body = params[:contact][:message][0]  
    

    Furthermore \n\r are line endings of a text box. Assuming that the e-mail you’re sending is HTML the \n\r should be replaced by <br> in the String

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple form where a user can add, edit, and delete people
I have a simple form like this: <form name=serachForm method=post action=/home/search> <input type=text name=searchText
I have a page like this. User write an URL into a form and
I have an HTML page with a simple form. When the user clicks submit,
I have simple form like this which accepts only two values string action and
Have a simple form (only extract fields here) but for some reason the JQserilization
Maybe someone can help me out. I have created a simple web user control,
I have a simple form with one text box and a panel with three
I have a pretty simple form with a listbox, a text box, and two
I have a simple form with one text box that pass data to SQL

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.