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

  • Home
  • SEARCH
  • 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 8385885
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T17:46:44+00:00 2026-06-09T17:46:44+00:00

I am new to the Rails framework and Ruby language in general but I

  • 0

I am new to the Rails framework and Ruby language in general but I do have some programming and MVC experience. I am trying to output a link using rails’ link_to method. However in the HTML this link is inside another set of double quotes. I need to escape the quotes produced by rails in the tag.

I have tried google and only found information for javascript escaping which didnt help. I tried using a h(%[]) method that was mentioned a few times but then the link was not created and the actual words link_to were out put.

Does anyone know how I can escape the double quotes in the hyperlink tag created by rails or switch it to use a single quote?

Actual Code

<% @properties = Property.all 
                            @properties.each do |property| %>
                            <img src="images/img<%= property.id %>.jpg" alt="" title="<strong><%= property.address %></strong><span>9 rooms, 3 baths, 6 beds, building size: 5000 sq. ft. &nbsp; &nbsp; &nbsp; Price: $ 600 000 &nbsp; &nbsp; &nbsp; <%= link_to "Read More", property) %></span>">
                            <% end %>

Output

<img src="images/img1.jpg" alt="" title="<strong>50 Craft LAne</strong><span>9 rooms, 3 baths, 6 beds, building size: 5000 sq. ft. &nbsp; &nbsp; &nbsp; Price: $ 600 000 &nbsp; &nbsp; &nbsp; <a href="/properties/1">Read More</a></span>">

The first double quote in the hyperlink is pairing with the title=” and then everything is off

  • 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-09T17:46:45+00:00Added an answer on June 9, 2026 at 5:46 pm

    You can do something like that:

    <%= link_to("Read More", property).gsub("\"", "'") %>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Ruby (and the Rails framework) is the first new programming language that I've learned
I am trying to start a new Rails project but I am getting a
new to Ruby so I'm still getting to grips with some of the Rails
After learning power of Rails framework, I have started learning ruby. In Ruby, I
I'm new to Ruby and trying to get it to run, but when I
I am a Java developer. Is there some Django/Ruby-on-Rails kind of framework for Java?
I'm new to Rails and Ruby. I'm trying to create a test project with
Starting a new rails project and we have a well-thought-out color palette, and want
I've just started a brand new rails project and the first task I'm trying
I've set up a new Rails 2.3.2 app and added the Basecamp API ruby

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.