Blank Pages rendered from view


#1

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

#2

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


#3

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