On Apr 7, 9:43 am, Jonathan Rochkind <[email protected]> wrote:
> I have a view partial that is used to render a small block of HTML
> content.  Because of where it's going to be placed in the HTML, it's
> important that it not begin or end with any HTML whitespace.
>
> But making a sample view partial that contains nothing but a simple
> string, just to test things out -- when rendered it seems to still end
> with a newline, which is of course HTML whitespace. Even though there's
> no newline in the html.erb file.
>
> Is there any simple way to make a partial view render with no newline at
> the end -- or the more general question, what I'm really after, with no
> HTML whitespace at the start or end of the partial view content?

My (wild) guess is that it's actually your ERB tag that's adding the
newline.

You can use a minus sign as part of the closing ERB tag to indicate
that you don't want the newline:

<%= render :partial => 'blah' -%>

Maybe this will help?

Jeff

purpleworkshops.com

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to