In RoR, is there an easy way to prevent the view from outputting <p> tags?
Posted
by dt
on Stack Overflow
See other posts from Stack Overflow
or by dt
Published on 2010-04-27T05:47:24Z
Indexed on
2010/04/27
6:03 UTC
Read the original article
Hit count: 199
ruby-on-rails
I'm new to Ruby and Rails and I have a simple controller that shows an item from the database in a default view. When it is displaying in HTML it is outputting <p>
tags along with the text content. Is there a way to prevent this from happening? I suppose if there isn't, is there at least a way to set the default css class for the same output in a statement such as this:
<% @Items.each do |i| %>
<%= i.itemname %>
<div class="menu_body">
<a href="#">Link-1</a>
</div>
<% end %>
So the problem is with the <%= i.itemname %>
part. Is there a way to stop it from wrapping it in its own <p>
tags? Or set the css class for the output?
Thanks!
© Stack Overflow or respective owner