# Blank Pages rendered from view

**URL:** <https://www.ruby-forum.com/t/blank-pages-rendered-from-view/80792>\
**Category:** Rails\
**Created:** [December 31, 2006, 12:38am UTC](https://www.ruby-forum.com/t/blank-pages-rendered-from-view/80792 "2006-12-31T00:38:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![chucky](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/b782af/32.png) [@chucky](https://www.ruby-forum.com/u/chucky)\
**Post date:** [December 31, 2006, 12:38am UTC](https://www.ruby-forum.com/t/blank-pages-rendered-from-view/80792/1 "2006-12-31T00:38:23Z")

</div>

For some reason, any code in my view folder that contains \<% form\_tag  
do %\> followed by text and variables only produces a blank page with no  
errors. If I remove the form\_tag statements and leave only text, the  
page is displayed fine.

I tried putting \<%= @content\_for\_layout%\> in my  
layout/application.rhtml file based on a recommendation from another  
post but it did not help.

The file is actually my login.rhtml used in acts\_as\_authenticated but I  
have tried all kinds of simplified variations and have concluded that  
the problem stems from that fact that for some reason, the form\_tag do  
command cannot display it’s output. I’m kinda stuck at the moment and  
any help at all would be greatly appreciated. Thanks!

The code from login.rhtml:  
\<% form\_tag do -%\>

Login  
\<%= text\_field\_tag 'login' %\>

Password  
\<%= password\_field\_tag 'password' %\>

\<%= submit\_tag 'Log in' %\>

\<% end -%\>

---

<div class="post-metadata">

**Author:** ![chucky](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/b782af/32.png) [@chucky](https://www.ruby-forum.com/u/chucky)\
**Post date:** [December 31, 2006, 3:05am UTC](https://www.ruby-forum.com/t/blank-pages-rendered-from-view/80792/2 "2006-12-31T03:05:12Z")

</div>

Hi Chucky,

Chucky wrote:

> For some reason, any code in my view folder that contains \<% form\_tag do  
> %\> followed by text and variables only produces a blank page with no  
> errors.

I’ve not worked with the … ‘do’, but if not too much has changed, it  
might  
be because you’re not telling Rails to render your form tags. Try …  
\<%=  
form\_tag …

hth,  
Bill

If I remove the form\_tag statements and leave only text, the

---

<div class="post-metadata">

**Author:** ![chucky](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/b782af/32.png) [@chucky](https://www.ruby-forum.com/u/chucky)\
**Post date:** [December 31, 2006, 10:42am UTC](https://www.ruby-forum.com/t/blank-pages-rendered-from-view/80792/3 "2006-12-31T10:42:08Z")

</div>

Chucky wrote:

> For some reason, any code in my view folder that contains \<% form\_tag  
> do %\> followed by text and variables only produces a blank page with no  
> errors. If I remove the form\_tag statements and leave only text, the  
> page is displayed fine.

What version of Rails are you using? Using a block with form\_tag was  
only introduced on October 24th:

[http://www.loudthinking.com/arc/2006\_10.html](http://www.loudthinking.com/arc/2006_10.html)

so unless you are on Edge or using the release candidate for 1.2, it  
won’t work for you.

regards

Justin
