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 8655079
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T14:56:32+00:00 2026-06-12T14:56:32+00:00

I am very new in ruby, in rails and in haml. I was recoding

  • 0

I am very new in ruby, in rails and in haml. I was recoding a little site I have, and I was trying to create a link in wich is nested a few elements.

The structure I want to be outputted is this one:

<a href="somewhere">
    <span>
         <img src="/imgs/hello.png" />
    </span>
    <strong>6
        <em>Oct</em>
    </strong>
    <h1>Title</h1>
</a>

So I was trying it doing this (obviously its real indentation is one tab more than the parent element):

= link_to("somewhere") do 
    %span
        %img(src="/imgs/hello.png")
    %strong 6
        %em Oct
    %h1 Title
end

Wich for me seems to be logic. But it does not. It gives me this error:

Inconsistent indentation: ” \t\t\t\t\t” was used for indentation, but the rest of the document was indented using 1 tab.

The error line number it’s the first line after link_to; the %span element. So, I thought it was because I was not using link_to in a correct way, but seeing that the error talks about indentation problems and after trying it in many different ways, I cannot get it into run.

  • 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-12T14:56:34+00:00Added an answer on June 12, 2026 at 2:56 pm

    This should work.

    = link_to("somewhere") do
      %span
        %img(src="/imgs/hello.png")
        %strong 
          6
          %em Oct
      %h1 Title
    

    Also, make sure in your editor you’re using spaces as tabs. This will get rid of any funky business.

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

Sidebar

Related Questions

I have built a very simple blog application using Ruby on Rails. New to
I'm fairly new in the Ruby + Rails scene. Although I have a very
I'm very new to Ruby on Rails and learning while trying to fix some
I'm very new to Ruby on Rails, and even newer to Haml, i started
I'm very new to Ruby on Rails, and have been getting the following error
I am very new to ruby / rails and have an issue that I
I’m very new in ruby on rails. I’m stuck with a problem. I have
I am very new to ruby and rails, I wanted to have an attribute
I'm very new to Ruby on Rails so please go easy! I've uploaded the
I'm very new to ruby. I'm trying to search for any instance of a

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.