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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T20:25:58+00:00 2026-05-27T20:25:58+00:00

I forked a Rails project that uses Haml, which I haven’t really learned. There’s

  • 0

I forked a Rails project that uses Haml, which I haven’t really learned. There’s an online converter that helped me with the HTML, but it ignores the erb, and when I tested my own conversion, the flash messages didn’t have the classes associated with them, so I know I did it wrong, but I can’t see why.

Note (don’t worry about spacing in the haml. in the code i have

Original haml

 - if flash[:notice]
        .alert-message.warning
          %p
            = flash[:notice]
      - if flash[:error]
        .alert-message.error
          %p
            = flash[:error]

faulty Html translation

<% if flash[:notice] %>
    <div class="alert-message.warning">
    <p>
     <%= flash[:notice] %>
    </p>
    </div>
 <% end %>
   <% if flash[:error] %>
   <div class="alert-message.error">
   <p>
   <%= flash[:error] %>
   </p>
   </div>
   <% end %>
  • 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-05-27T20:25:58+00:00Added an answer on May 27, 2026 at 8:25 pm

    You have a huge indentation after first line. It should be 2 spaces.

    edited: In case you need to convert small part of haml you can learn how to convert it manually. There is the little haml tutorial where you can learn some basics.
    That part of haml can be turned into following erb:

    <% if flash[:notice] %>
      <div class="alert-message warning">
       <p><%= flash[:notice] %></p>
      </div>
    <% end %>
    <% if flash[:error] %>
      <div class="alert-message error">
       <p><%= flash[:error] %></p>
      </div>
    <% end %>
    

    where:
    - same as <%

    = same as <%=

    %p (%tag_name) -> <p>

    .class -> %div.class -> <div class="class"

    edited#2:
    judging by generated html <div class="alert-message.warning"> should be <div class="alert-message warning"> (dot replaced by space between classes)

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

Sidebar

Related Questions

We're working on a Rails project on Heroku that needs to scrape and process
we use Rails and EventMachine together, and when using that combo with Passenger there
I have a form in Rails 3.0.3 that uses the new :remote=>true feature: <%=
I forked a project, made changes, and created a pull request which was accepted.
I've forked a project on GitHub that has some flash messages. For example, with
I've never forked a project before so I'm a little stumped as to how
I forked a project on github, since then the original owner made changes to
I have forked an SVN project using Git because I needed to add features
I forked the excellent zen-coding project, with an idea to implement DOM ascension using
Someone who understands how rails caching works can really help me out here. Here's

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.