Form_for problem after upgrading

I am upgrading to rails 3 and afer diong so, none of my form_for are
working. (I can not actually say not all of them are working but the
few that i have tried are not). The page loads fine but the form is
not output. This is after making the the change from <% to <%=. A
sample form is below.

<%= form_for @user_session, :url => user_session_path do |f| %>
  Email <br/>
  <%= text_field_tag :login %><br/>
  Password <br/>
  <%= f.password_field :password %><br/>
  Remember Me
  <%= f.check_box :remember_me %> <br/>
  <%= f.submit "Login" %>
<% end %>

<%= form_for @user_session, :url => user_session_path do |f| %>
  Email <br/>
  <%= text_field_tag :login %><br/>
  Password <br/>
  <%= f.password_field :password %><br/>
  Remember Me
  <%= f.check_box :remember_me %> <br/>
  <%= f.submit "Login" %>
<% end %>

replace <%= text_field_tag :login %><br/> with
<%= f.text_field :login %>

what is the output in the log?

<%= form_for @user_session, :url => user_session_path do |f| %>
<p><%= f.label( :login , "Email ") %><br />
<%= f.text_field :login %></p>
<p><%= f.label :password %><br />
<%= f.password_field :password %></p>
<p><%= f.label :remember_me%><br />
<%= f.text_field :remember_me%></p>
<p><%= f.submit "Login" %></p>
<% end %>

tashfeen.ekram wrote in post #957373:

I am upgrading to rails 3 and afer diong so, none of my form_for are
working. (I can not actually say not all of them are working but the
few that i have tried are not). The page loads fine but the form is
not output. This is after making the the change from <% to <%=. A
sample form is below.

<%= form_for @user_session, :url => user_session_path do |f| %>
  Email <br/>
  <%= text_field_tag :login %><br/>
  Password <br/>
  <%= f.password_field :password %><br/>
  Remember Me
  <%= f.check_box :remember_me %> <br/>
  <%= f.submit "Login" %>
<% end %>

Hi,

In that case you need to use 'dynamic-form' plugin for rails3

http://github.com/rails/dynamic_form

This plugin can auto modify you syntax at runtime.

Good Luck :wink:
-Ganesh K

hmmm... well i installed that plugin however i am still having no
luck.

form_tag seems to work properly.

my dev log does not give me any errors, just some depreciation warning
unrelated to this problem.

any ideas?

Any ideas? Below is the dev log when i load that page. none of the
below seems to be related.

Started GET "/login" for 127.0.0.1 at Wed Nov 03 19:53:35 -0400 2010
DEPRECATION WARNING: Base.named_scope has been deprecated, please use
Base.scope instead. (called from /var/www/drugbin/app/models/user.rb:
2)
DEPRECATION WARNING: Base.named_scope has been deprecated, please use
Base.scope instead. (called from /var/www/drugbin/app/models/user.rb:
2)
  SQL (0.6ms) describe `roles_users`
DEPRECATION WARNING: Base.named_scope has been deprecated, please use
Base.scope instead. (called from /var/www/drugbin/app/models/invite.rb:
16)
DEPRECATION WARNING: Base.named_scope has been deprecated, please use
Base.scope instead. (called from /var/www/drugbin/app/models/invite.rb:
17)
DEPRECATION WARNING: Base.named_scope has been deprecated, please use
Base.scope instead. (called from /var/www/drugbin/app/models/invite.rb:
18)
DEPRECATION WARNING: Base.named_scope has been deprecated, please use
Base.scope instead. (called from /var/www/drugbin/app/models/invite.rb:
19)
DEPRECATION WARNING: Setting filter_parameter_logging in
ActionController is deprecated and has no longer effect, please set
'config.filter_parameters' in config/application.rb instead. (called
from /var/www/drugbin/app/controllers/application_controller.rb:6)
DEPRECATION WARNING: Setting filter_parameter_logging in
ActionController is deprecated and has no longer effect, please set
'config.filter_parameters' in config/application.rb instead. (called
from /var/www/drugbin/app/controllers/application_controller.rb:17)
  Processing by UserSessionsController#new as HTML
  SiteSetting Load (0.3ms) SELECT `site_settings`.* FROM
`site_settings` LIMIT 1
Rendered shared/_includes_header.html.erb (4.8ms)
Rendered shared/_header_wo_login.html.erb (4.6ms)
Rendered user_sessions/new.html.erb within layouts/application
(18.4ms)
Completed 200 OK in 44ms (Views: 31.2ms | ActiveRecord: 0.9ms)

even when i add random text with the form liek "Email" as below is not
even outputted. it is as if the whole blcok is being ignored...

<%= form_for @user_session, :url => user_session_path do |f| %>
        Email <br/>
  <%= text_field_tag :login %><br/>
  Password <br/>
  <%= f.password_field :password %><br/>
  Remember Me
  <%= f.check_box :remember_me %> <br/>
  <%= f.submit "Login" %>
<% end %>

solution found. there is apparently a conflict with an older version
of haml.

https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/5493

install haml 3.0.18 or higher to resolve.