Forum: Ruby on Rails Problem with form_tag

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.
A73f446eaaf56db0aeaa578aa373989b?d=identicon&s=25 Terry Donaghe (Guest)
on 2007-04-21 01:19
(Received via mailing list)
Hi all!

I've seen this problem in several places in the list, but none of the
remedies suggested seem to be helping me much.

I have a view like so:

HELLO
<% form_tag :action => "create" do %>
       <p>My pretty form!</p>
       <p><%= text_field "foo", "bar"  %></p>
       <p><%= submit_tag "Do it!" %></p>
<% end %>

When the page displays, it only has "HELLO" - the form doesn't show up
at
all in the outputted HTML.

I've done a rails -v and it says I'm running 1.2.2

I looked in my environment.rb file and it showed "RAILS_GEM_VERSION =
'1.1.6
'"

So, I changed it to show 1.2.2, and then I read somewhere that I needed
to
rake rails:update

Did all that and I still just get HELLO without the form.

I just tried the 1.1.6 version like so:

HELLO
<% start_form_tag :action => "create" %>
       <p>My pretty form!</p>
       <p><%= text_field "foo", "bar"  %></p>
       <p><%= submit_tag "Do it!" %></p>
<% end_form_tag %>

And that spits out a form.  Why is the old version working, but the new
version isn't?  Is there some other way to see what version of Rails I'm
really using?

Thanks for any help!

--
Terry (TAD) Donaghe
http://tadspot.tumblr.com
C4dc94c893471878a105761a9207f29b?d=identicon&s=25 Zack Chandler (Guest)
on 2007-04-21 03:30
(Received via mailing list)
> When the page displays, it only has "HELLO" - the form doesn't show up at
> Did all that and I still just get HELLO without the form.
> And that spits out a form.  Why is the old version working, but the new
> version isn't?  Is there some other way to see what version of Rails I'm
> really using?
>

Terry,

If you specify RAILS_GEM_VERSION then that is the version of Rails
loaded.
If you don't specify a version, Rails will look in vendor/ for a
rails/ dir and load that if it exists.  Otherwise it'll load the most
recent version of the rails gem.

Hope this helps,

--
Zack Chandler
http://depixelate.com
This topic is locked and can not be replied to.