form_for error

Hi all,

I have the following code in my application layout:

<div id="utility">
  <% if logged_in? %>
    <%= link_to "Sign Out", logout_path %>
  <% else %>

   <%= link_to_function "Sign in",
   "$('signin').toggle();$('signin_link').toggle()",
   :id => "signin_link" %>

    <%= form_tag login_path, {:id => "signin"}, {:style =>"display:
none"} %>
       Log In<%= text_field_tag 'login' %>
       Password<%= password_field_tag 'password' %>
    <%= submit_tag 'Sign In' %>

<% end %>
  <% end %>
</div>

and for some reason it complains about the <% end %> tag corresponding
to the form_tag with this message -> syntax error, unexpected kEND,
expecting $end

If I replace the second <% end %> with </form> It works fine.

Any ideas what the heck is going on here?

Thanks,
steve

Hi all,

I have the following code in my application layout:

<div id="utility">
<% if logged_in? %>
   <%= link_to "Sign Out", logout_path %>
<% else %>

  <%= link_to_function "Sign in",
  "$('signin').toggle();$('signin_link').toggle()",
  :id => "signin_link" %>

   <%= form_tag login_path, {:id => "signin"}, {:style =>"display:
none"} %>
      Log In<%= text_field_tag 'login' %>
      Password<%= password_field_tag 'password' %>
   <%= submit_tag 'Sign In' %>

<% end %>
<% end %>
</div>

and for some reason it complains about the <% end %> tag corresponding
to the form_tag with this message -> syntax error, unexpected kEND,
expecting $end

if you forget about all the bits in the middle you're just doing
form_tag(...)
end

Which is obviously a syntax error. On the other hand,
form_tag(...) do
end

is fine.
When using form_tag like this you need to use <% and not <%=

Fred