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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T19:42:25+00:00 2026-05-18T19:42:25+00:00

In Rails ERB, you can suppress newlines by adding a trailing hyphen to tags:

  • 0

In Rails ERB, you can suppress newlines by adding a trailing hyphen to tags:

<ul>
  <% for @item in @items -%>
    <li><%= @item %></li>
  <% end -%>
</ul>

becomes:

<ul>
    <li>apple</li>
    <li>banana</li>
    <li>cacao</li>
</ul>

Is there a way to do this in Django? (Disclosure: I’m generating a csv file with Django)

Edit: Clarified that the newlines I’m hunting down are the ones left behind after the template tags.

  • 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-18T19:42:26+00:00Added an answer on May 18, 2026 at 7:42 pm

    The closest I’ve found to what you’re looking for (I’m looking for the same thing) is talk about a future patch, here: http://code.djangoproject.com/ticket/2594.

    Unfortunately, it looks like there’s not much you can do until they merge that patch in.

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

Sidebar

Related Questions

Can embedded ruby (erb) be used outside of rails in regular webpages to dynamically
I'm wondering how I can embed Rails code inside an html.erb so that I
I am attempting to parse, not evaluate, rails ERB files in a Hpricot/Nokogiri type
it seems that on Rails or erb, the only way to output anything is
Experiencing jquery in rails through .js.erb templates; but completely puzzled by a simple problem
In my rails view(index.html.erb), i have following structure <div> <%= render :partial => create
I want to update an erb.html page in rails with information from a webscraping
I am using rails beta 3 and I have a erb page named index.html.erb
In Rails, I want to run the js.erb file associated with an action on
(Warning: Clueless Rails Newbie!) In my show.html.erb for my albums view, I call 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.