# Form\_tag issues after Rails upgrade to 2.0.2

**URL:** <https://www.ruby-forum.com/t/form-tag-issues-after-rails-upgrade-to-2-0-2/124948>\
**Category:** Rails\
**Created:** [January 3, 2008, 11:14pm UTC](https://www.ruby-forum.com/t/form-tag-issues-after-rails-upgrade-to-2-0-2/124948 "2008-01-03T23:14:55Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![destiney](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/f07891/32.png) [@destiney](https://www.ruby-forum.com/u/destiney)\
**Post date:** [January 3, 2008, 11:14pm UTC](https://www.ruby-forum.com/t/form-tag-issues-after-rails-upgrade-to-2-0-2/124948/1 "2008-01-03T23:14:55Z")

</div>

Any idea why this form\_tag is broken after moving from Rails 1.2.6 →   
2.0.2?

\<% form\_tag :controller =\> ‘login’, :action =\> ‘login’ do -%\>

I get the error:

wrong number of arguments (1 for 2)

I have tried several other incantations, but none work, same error:

\<% form\_tag( :controller =\> ‘login’, :action =\> ‘login’ ) do -%\>

\<% form\_tag( { :controller =\> ‘login’, :action =\> ‘login’ } ) do -%\>

And what’s even more strange is there’s another form\_tag call above  
this one that _isn’t_ throwing an error.

\<% form\_tag :controller =\> ‘login’, :action =\> ‘logout’ do -%\>

–  
Greg D.  
[http://destiney.com/](http://destiney.com/)

---

<div class="post-metadata">

**Author:** ![destiney](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/f07891/32.png) [@destiney](https://www.ruby-forum.com/u/destiney)\
**Post date:** [January 3, 2008, 11:55pm UTC](https://www.ruby-forum.com/t/form-tag-issues-after-rails-upgrade-to-2-0-2/124948/2 "2008-01-03T23:55:27Z")

</div>

Would it have anything to do with the :controller and :action being  
different? That’s the only difference I see in them.

On Jan 4, 2008 8:44 AM, Greg D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> \<% form\_tag :controller =\> ‘login’, :action =\> ‘logout’ do -%\>
> 
> –  
> Greg D.  
> [http://destiney.com/](http://destiney.com/)
> 
> >

–  
Ryan B.

> **[frozenplague.net](http://www.frozenplague.net)**
>
> This domain may be for sale!

Feel free to add me to MSN and/or GTalk as this email.

---

<div class="post-metadata">

**Author:** ![destiney](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/f07891/32.png) [@destiney](https://www.ruby-forum.com/u/destiney)\
**Post date:** [January 4, 2008, 12:13am UTC](https://www.ruby-forum.com/t/form-tag-issues-after-rails-upgrade-to-2-0-2/124948/3 "2008-01-04T00:13:10Z")

</div>

On 1/3/08, Ryan B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Would it have anything to do with the :controller and :action being  
> different? That’s the only difference I see in them.

The problem is with reverse\_proxy\_fix. Anything that uses url\_for is  
b0rken, even the latest version from svn.

–  
Greg D.  
[http://destiney.com/](http://destiney.com/)

---

<div class="post-metadata">

**Author:** ![destiney](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/f07891/32.png) [@destiney](https://www.ruby-forum.com/u/destiney)\
**Post date:** [January 4, 2008, 12:59am UTC](https://www.ruby-forum.com/t/form-tag-issues-after-rails-upgrade-to-2-0-2/124948/4 "2008-01-04T00:59:23Z")

</div>

Are you positive? I’m the maintainer of that. When you install it, make  
sure  
you install the correct version for your version of Rails.

From my blog:

[http://www.napcsweb.com/blog/2007/12/18/reverse\_proxy\_fix-1041-released-with-rails-20-support/](http://www.napcsweb.com/blog/2007/12/18/reverse_proxy_fix-1041-released-with-rails-20-support/)

---

<div class="post-metadata">

**Author:** ![destiney](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/f07891/32.png) [@destiney](https://www.ruby-forum.com/u/destiney)\
**Post date:** [January 4, 2008, 5:53pm UTC](https://www.ruby-forum.com/t/form-tag-issues-after-rails-upgrade-to-2-0-2/124948/5 "2008-01-04T17:53:22Z")

</div>

On 1/4/08, Greg D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Unknown command: [http://svn.napcsweb.com/public/reverse\_proxy\_fix](http://svn.napcsweb.com/public/reverse_proxy_fix)  
> The FileUtils require seems to be the problem. If I modify install.rb  
> like this:

#require ‘FileUtils’  
require ‘/usr/local/lib/ruby/1.8/fileutils.rb’

It then runs the install.

Meanwhile my PATH and ruby $LOAD\_PATH seems perfectly fine otherwise:

> which ruby  
> /usr/local/bin/ruby

> irb
> 
> > FileUtils.class  
> > =\> Module  
> > $LOAD\_PATH  
> > =\> [“/usr/local/lib/ruby/gems/1.8/gems/wirble-0.1.2/bin”,  
> > “/usr/local/lib/ruby/gems/1.8/gems/wirble-0.1.2/.”,  
> > “/usr/local/lib/ruby/site\_ruby/1.8”,  
> > “/usr/local/lib/ruby/site\_ruby/1.8/i686-linux”,  
> > “/usr/local/lib/ruby/site\_ruby”, “/usr/local/lib/ruby/1.8”,  
> > “/usr/local/lib/ruby/1.8/i686-linux”, “.”]

Maybe script/plugin has some issue? _shrug_

–  
Greg D.  
[http://destiney.com/](http://destiney.com/)

---

<div class="post-metadata">

**Author:** ![destiney](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/f07891/32.png) [@destiney](https://www.ruby-forum.com/u/destiney)\
**Post date:** [January 4, 2008, 5:15pm UTC](https://www.ruby-forum.com/t/form-tag-issues-after-rails-upgrade-to-2-0-2/124948/6 "2008-01-04T17:15:43Z")

</div>

On 1/3/08, Brian H. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Are you positive? I’m the maintainer of that. When you install it, make sure  
> you install the correct version for your version of Rails.
> 
> From my blog:
> 
> [http://www.napcsweb.com/blog/2007/12/18/reverse\_proxy\_fix-1041-released-with-rails-20-support/](http://www.napcsweb.com/blog/2007/12/18/reverse_proxy_fix-1041-released-with-rails-20-support/)

Yes. The version from subversion doesn’t work. Anything that uses  
url\_for doesn’t work, form\_tag and link\_to specifically.

And then following the instruction here:

[http://www.napcsweb.com/blog/2007/12/18/reverse\_proxy\_fix-1041-released-with-rails-20-support/](http://www.napcsweb.com/blog/2007/12/18/reverse_proxy_fix-1041-released-with-rails-20-support/)

This version dies before completing the install:

> script/plugin install [http://svn.napcsweb.com/public/reverse\_proxy\_fix](http://svn.napcsweb.com/public/reverse_proxy_fix)

- ./README
- ./Rakefile
- ./init.rb
- ./install.rb
- ./lib/116.rb
- ./lib/123.rb
- ./lib/20.rb
- ./lib/config.rb
- ./tasks/reverse\_proxy\_fix\_tasks.rake  
Unknown command: [http://svn.napcsweb.com/public/reverse\_proxy\_fix](http://svn.napcsweb.com/public/reverse_proxy_fix)

Here’s my setup if that helps:

> ruby -v  
> ruby 1.8.6 (2007-09-23 patchlevel 110) [i686-linux]

> gem li

\*\*\* LOCAL GEMS \*\*\*

actionmailer (2.0.2)  
actionpack (2.0.2)  
activerecord (2.0.2)  
activerecord-oracle-adapter (1.0.0)  
activeresource (2.0.2)  
activesupport (2.0.2)  
calendar\_grid (1.0.3)  
capistrano (2.1.0)  
cgi\_multipart\_eof\_fix (2.5.0)  
daemons (1.0.9)  
fastthread (1.0.1)  
fcgi (0.8.7)  
gem\_plugin (0.2.3)  
highline (1.4.0)  
mongrel (1.1.3)  
mysql (2.7)  
needle (1.3.0)  
net-sftp (1.1.0)  
net-ssh (1.1.2)  
postgres (0.7.9.2008.01.03)  
rails (2.0.2)  
rake (0.8.1)  
ruby-debug-base (0.10.0)  
ruby-net-ldap (0.0.4)  
rubygems-update (1.0.1)  
sources (0.0.1)  
sqlite3-ruby (1.2.1)  
termios (0.9.4)  
wirble (0.1.2)

–  
Greg D.  
[http://destiney.com/](http://destiney.com/)

---

<div class="post-metadata">

**Author:** ![destiney](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/f07891/32.png) [@destiney](https://www.ruby-forum.com/u/destiney)\
**Post date:** [January 4, 2008, 10:21pm UTC](https://www.ruby-forum.com/t/form-tag-issues-after-rails-upgrade-to-2-0-2/124948/7 "2008-01-04T22:21:23Z")

</div>

On 1/4/08, Brian H. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Well, this is meant for Windows users, but I did test this on the macbook  
> pro here without incident. I’ll look into this more.
> 
> When you say “the version from subversion doesn’t work” where are you  
> looking?
> 
> [http://svn.napcsweb.com/public/reverse\_proxy\_fix](http://svn.napcsweb.com/public/reverse_proxy_fix) is the  
> path to the latest version.

That’s the place. I found that repo in someone’s blog before I found  
your actual plugin install instructions.

> In rails 2.0, url\_for was changed to accept one paramenter. That’s why the  
> plugin contains multiple versions of reverse\_proxy\_fix.rb If you have  
> problems, simply do it by hand:
> 
> rename 20.rb to reverse\_proxy\_fix.rb in the plugin’s lib folder. Then just  
> set the base path yourself in the config.rb file in the plugin’s lib folder.

Yeah, I got it working after tinkering a bit with the install.rb.

Thanks for the responses. Let me know if there’s anything I can  
provide to help debug. It’s just weird how that require bombs for no  
apparent reason.

–  
Greg D.  
[http://destiney.com/](http://destiney.com/)

---

<div class="post-metadata">

**Author:** ![destiney](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/f07891/32.png) [@destiney](https://www.ruby-forum.com/u/destiney)\
**Post date:** [January 4, 2008, 6:40pm UTC](https://www.ruby-forum.com/t/form-tag-issues-after-rails-upgrade-to-2-0-2/124948/8 "2008-01-04T18:40:58Z")

</div>

Well, this is meant for Windows users, but I did test this on the  
macbook  
pro here without incident. I’ll look into this more.

When you say “the version from subversion doesn’t work” where are you  
looking?

[http://svn.napcsweb.com/public/reverse\_proxy\_fix](http://svn.napcsweb.com/public/reverse_proxy_fix) is the path to the  
latest  
version.

In rails 2.0, url\_for was changed to accept one paramenter. That’s why  
the  
plugin contains multiple versions of reverse\_proxy\_fix.rb If you  
have  
problems, simply do it by hand:

rename 20.rb to reverse\_proxy\_fix.rb in the plugin’s lib folder. Then  
just  
set the base path yourself in the config.rb file in the plugin’s lib  
folder.
