Form_tag broken in Rails 1.2 RC2 or is it me?

I’m using Rails 1.2 RC2 and I’ve got a view that uses form_tag and the
form is not being rendered. It’s just not there. My view is this:

Log in <% form_tag do %>
SSO ID: <%= text_field_tag :sso_id, params[:sso_id] %>
Password: <%= password_field_tag :password, params[:password] %>
<%= submit_tag "Login" %> <% end %>

My browser output is this:

Log in

As you can see, it’s just not there. Do I have an error in my view or
is there a problem with form_tag in the latest release candidate?


Sterling A.
sterling [at] sterlinganderson.net
http://sterlinganderson.net/

Sterling A. wrote:

I’m using Rails 1.2 RC2 and I’ve got a view that uses form_tag and the
form is not being rendered. It’s just not there. My view is this:

Log in <% form_tag do %>

<%= form_tag do %>

On 1/17/07, Andrew S. [email protected] wrote:

<%= form_tag do %>
It should be using the block’s binding to output, so that isn’t
necessary. I don’t even think the erb will parse correctly.

Are you sure you’re using the right gem? This sounds like you’re
still on 1.1.6.


Rick O.
http://weblog.techno-weenie.net
http://mephistoblog.com

On 1/17/07, Andrew S. [email protected] wrote:

<%= form_tag do %>
That is incorrect[1][2]. An exception will be thrown

If I do the following:

<%= form_tag %>
form fields…

the opening form tag is not rendered. So it appears form_tag is not
doing anything.

[1]http://www.loudthinking.com/arc/000601.html
[2]http://weblog.rubyonrails.org/2006/11/26/1-2-new-in-actionpack


Sterling A.
sterling [at] sterlinganderson.net
http://sterlinganderson.net/

On 1/17/07, Andrew S. [email protected] wrote:

<%= form_tag do %>
I ran into problems like this when migrating to 1.2rc1 – if I recall
correctly the problem was that my environment configuration still
claimed to be 1.1.6. Have you updated rails within the app?

-faisal

On 1/18/07, Faisal N Jawdat [email protected] wrote:

I ran into problems like this when migrating to 1.2rc1 – if I recall
correctly the problem was that my environment configuration still
claimed to be 1.1.6. Have you updated rails within the app?

Crikey. I totally forget to check the RAILS_GEM_VERSION environment
variable. I commented out the line

RAILS_GEM_VERSION = ‘1.1.6’

in my environment.rb and lo and behold everything works fine.


Sterling A.
sterling [at] sterlinganderson.net
http://sterlinganderson.net/
608.239.8387

Sterling A. wrote:

On 1/17/07, Andrew S. [email protected] wrote:

<%= form_tag do %>
That is incorrect[1][2]. An exception will be thrown

If I do the following:

<%= form_tag %>
form fields…

the opening form tag is not rendered. So it appears form_tag is not
doing anything.

[1]http://www.loudthinking.com/arc/000601.html
[2]http://weblog.rubyonrails.org/2006/11/26/1-2-new-in-actionpack


Sterling A.
sterling [at] sterlinganderson.net
http://sterlinganderson.net/

Opps - your right, I’m wrong. I am even looking at some of my own code
that does not contain “<%=” !

But Rick’s comment rang a bell - I was looking at this exact issue last
night with a friend. He is using Locomotive, which is based on an older
version (I am using 1.2RC2 ATM). Changing the line to “<%=
start_form_tag …” fixed it for him.

Hi, you can also do the following:

RAILS_GEM_VERSION = ‘1.1.6.xxxx’ where xxxx is the revision number.

e.g.

RAILS_GEM_VERSION = ‘1.1.6.5959’

I wouldn’t recommend commenting something out that my be referenced by
other parts of the rails system. After updating this file, then you
should perform the following action:

rake rails:update

Good luck,

-Conrad

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs