On 17 February 2011 04:19, khoan <[email protected]> wrote:
> Hi all,
>
> I'd like to unindent a block of ERB specifically to combat the extra
> spacing being added to content inside <textarea> by the browser. Is
> there such a feature in ERB?
>
> I shall denote indentation with underscores in the pseudo code example
> below.
>
> Thanks in advance,
> Khoan.
>
>
> myview.erb:
>
> <html ...>
> __<%= render 'form' %>
> </html>
>
>
> _form.erb:
>
> <% form_for ... do %>
> __<%= render 'unindented' %>
> <% end %>
>
>
> _unindented.erb:
>
> <textarea><%= 'this is unindented' %></textarea>
>
>
> which would output something along the line of:
>
> <html ...>
> __<form ...>
> ____<textarea>this is unindented</textarea>

I don't think so, have you tried it and checked the html (View > Page
Source or similar in the browser).  The line
 __<%= render 'unindented' %>
says output underlines then render unindented.  There is no way that
you can remove the underlines before the <%= render %>.  However why
not just put, at the start of the line
<%= render 'unindented' %>
However I do not understand why it matters.  None of this will give
you extra space *inside* the textarea.

Colin

-- 
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