# What do these tags do \<%- xxxxxx -%\>

**URL:** <https://www.ruby-forum.com/t/what-do-these-tags-do-xxxxxx/174649>\
**Category:** Rails\
**Created:** [August 31, 2009, 1:23am UTC](https://www.ruby-forum.com/t/what-do-these-tags-do-xxxxxx/174649 "2009-08-31T01:23:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jyothsna](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/aca169/32.png) [@jyothsna](https://www.ruby-forum.com/u/jyothsna)\
**Post date:** [August 31, 2009, 1:23am UTC](https://www.ruby-forum.com/t/what-do-these-tags-do-xxxxxx/174649/1 "2009-08-31T01:23:53Z")

</div>

Hi,

I see some code from some open source project.

in many of the view files(.erb) , I see the following statements.

Idont understand how they are interpreted…  
are they comments, or shown on UI, or just executed?

```auto
<%- column_div :type => :primary do -%>

  <h2>People Admin</h2>

  <%= will_paginate %>

  <ul class="list people admin">
    <%= render :partial => @people %>
  </ul>

  <%= will_paginate %>
<%- end -%>

<%- column_div :type => :secondary do -%>
  <%= render :partial => 'searches/box' %>
<%- end -%>

```

IN another file, they used these tags \<%= xxxxxx -%\>

```auto
<li class="vcard person">
  <%= person_link_with_image person, :class => "url fn" %> &mdash;
  <%- activity = activated_status(person) -%>
  <%= link_to activity,
              admin_person_path(person, :task => "deactivated"),
              :method => :put %>
  |
  <%- activity = person.admin? ? "unadmin" : "make admin" -%>
  <%= link_to activity,
              admin_person_path(person, :task => "admin"),
              :method => :put %>
  <p class="person_meta">
    <strong>Forum Posts:</strong>
    <%= person.forum_posts_count -%> |
    <strong>Blog Posts:</strong>
    <%= link_to person.blog.posts.count.to_s, blog_path(person) -%> |
    <strong>Connections:</strong>
      <%= link_to person.connections.count,
                  person_connections_path(person) -%>
  </p>
</li>
```

---

<div class="post-metadata">

**Author:** ![jyothsna](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/aca169/32.png) [@jyothsna](https://www.ruby-forum.com/u/jyothsna)\
**Post date:** [August 31, 2009, 3:29am UTC](https://www.ruby-forum.com/t/what-do-these-tags-do-xxxxxx/174649/2 "2009-08-31T03:29:57Z")

</div>

Look at the rendered source to see the difference immediately.

\<%- strips whitespace in front of the tag.

-%\> strips trailing whitespace, including the newline.

This is useful for rendering plain-text emails without a bunch of  
gibberish whitespace.

Best,  
jeremy

On Sun, Aug 30, 2009 at 4:23 PM, Jyothsna

---

<div class="post-metadata">

**Author:** ![jyothsna](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/aca169/32.png) [@jyothsna](https://www.ruby-forum.com/u/jyothsna)\
**Post date:** [August 31, 2009, 7:00am UTC](https://www.ruby-forum.com/t/what-do-these-tags-do-xxxxxx/174649/3 "2009-08-31T07:00:46Z")

</div>

Jeremy K. wrote:

> Look at the rendered source to see the difference immediately.
> 
> \<%- strips whitespace in front of the tag.
> 
> -%\> strips trailing whitespace, including the newline.
> 
> This is useful for rendering plain-text emails without a bunch of  
> gibberish whitespace.
> 
> Best,  
> jeremy
> 
> On Sun, Aug 30, 2009 at 4:23 PM, Jyothsna

THank you Jeremy.

which book did you follow.

in the books I read, I could not remember or search for it.

THanks,  
–Jyothsna
