Forum: Ruby on Rails Blank Pages rendered from view

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Chucky (Guest)
on 2006-12-31 01:38
(Received via mailing list)
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 -%>
<p><label for="login">Login</label><br/>
<%= text_field_tag 'login' %></p>

<p><label for="password">Password</label><br/>
<%= password_field_tag 'password' %></p>

<!-- Uncomment this if you want this functionality
<p><label for="remember_me">Remember me:</label>
<%= check_box_tag 'remember_me' %></p>
-->

<p><%= submit_tag 'Log in' %></p>
<% end -%>
Bill W. (Guest)
on 2006-12-31 04:05
(Received via mailing list)
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
Justin F. (Guest)
on 2006-12-31 11:42
(Received via mailing list)
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

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

regards

   Justin
This topic is locked and can not be replied to.