# Params not getting POSTed

**URL:** <https://www.ruby-forum.com/t/params-not-getting-posted/102197>\
**Category:** Rails\
**Created:** [August 12, 2006, 5:35pm UTC](https://www.ruby-forum.com/t/params-not-getting-posted/102197 "2006-08-12T17:35:37Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![sporkyy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c89c15/32.png) [@sporkyy](https://www.ruby-forum.com/u/sporkyy)\
**Post date:** [August 12, 2006, 5:35pm UTC](https://www.ruby-forum.com/t/params-not-getting-posted/102197/1 "2006-08-12T17:35:37Z")

</div>

I have a situation where no params are being sent when the form is  
submitted.

After the rendering this is the html that I get…

 Height: ft Weight: lbs 

Why would this result in a GET not a POST and no params being sent?

---

<div class="post-metadata">

**Author:** ![sporkyy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c89c15/32.png) [@sporkyy](https://www.ruby-forum.com/u/sporkyy)\
**Post date:** [August 12, 2006, 9:12pm UTC](https://www.ruby-forum.com/t/params-not-getting-posted/102197/2 "2006-08-12T21:12:02Z")

</div>

more info…

For some reason. Only a link to {:controller =\> ‘account’, :action =\>  
‘login’} will actually [POST]. If I change the link to something else  
i.e. {:controller =\> ‘stats’, :action =\> ‘new’} this will result in a  
[GET]

Whay is that?

---

<div class="post-metadata">

**Author:** ![sporkyy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c89c15/32.png) [@sporkyy](https://www.ruby-forum.com/u/sporkyy)\
**Post date:** [August 13, 2006, 6:19am UTC](https://www.ruby-forum.com/t/params-not-getting-posted/102197/3 "2006-08-13T06:19:04Z")

</div>

Thanks to Stef T,

The problem turned out to be that the word ‘stats’ on my shared host  
(dreamhost) is a special case. I just changed it to a different word  
and all was fine.

---

<div class="post-metadata">

**Author:** ![sporkyy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c89c15/32.png) [@sporkyy](https://www.ruby-forum.com/u/sporkyy)\
**Post date:** [August 15, 2006, 2:18pm UTC](https://www.ruby-forum.com/t/params-not-getting-posted/102197/4 "2006-08-15T14:18:18Z")

</div>

Todd S. wrote:

> more info…
> 
> For some reason. Only a link to {:controller =\> ‘account’, :action =\>  
> ‘login’} will actually [POST]. If I change the link to something else  
> i.e. {:controller =\> ‘stats’, :action =\> ‘new’} this will result in a  
> [GET]
> 
> Whay is that?

Sorry, I have not seen the rest of your thread, but can you check the  
top of your controller file?  
You may have something like this in your file:

# GETs should be safe (see

[URIs, Addressability, and the use of HTTP GET and POST](http://www.w3.org/2001/tag/doc/whenToUseGet.html))  
verify :method =\> :post, :only =\> [:destroy, :create, :update],  
:redirect\_to =\> { :action =\> :list }

I’m not sure but that may be the reason why only certain types of forms  
are being posted… but I’m not sure! 🙂  
Cheers  
Mohit.

---

<div class="post-metadata">

**Author:** ![sporkyy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c89c15/32.png) [@sporkyy](https://www.ruby-forum.com/u/sporkyy)\
**Post date:** [August 15, 2006, 2:18pm UTC](https://www.ruby-forum.com/t/params-not-getting-posted/102197/5 "2006-08-15T14:18:25Z")

</div>

Hello Todd,  
You know, the first thought that struck me was, if these systems are  
the same (codebase wise) and the controllers and routes is the same, and  
your probably on a -shared- hosting enviroment, maybe the host provider  
is already grabbing requests for ‘stats’ to your domain/machine before  
it even gets to your webserver/rails ? Much like trying to use a  
‘reserved’ keyword for a class in ruby or a tablename in postgreSQL  
(create table null as …).

```
For humour sake, I would try re-naming the controller from stats to

```

something totally un-ambiguous like ‘mygroovystats’ (or such forth). I  
dare say that this problem will go away at that point 😉 Let us all know  
how it goes either way.

```
Regards
Stef
```

---

<div class="post-metadata">

**Author:** ![sporkyy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c89c15/32.png) [@sporkyy](https://www.ruby-forum.com/u/sporkyy)\
**Post date:** [August 15, 2006, 2:18pm UTC](https://www.ruby-forum.com/t/params-not-getting-posted/102197/6 "2006-08-15T14:18:33Z")

</div>

Hello Todd,  
What does your ‘tail -f log/development.log’ show ? I dare say that  
the form is posting fine, but your ruby inside the target controller  
/stats/new is not expecting the hashes of hashes format\*

```
Regards
Stef

```

(\* NB: I have been wrong before, could be wrong now, and will continue  
to be wrong in the future 😉

---

<div class="post-metadata">

**Author:** ![sporkyy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c89c15/32.png) [@sporkyy](https://www.ruby-forum.com/u/sporkyy)\
**Post date:** [August 12, 2006, 11:03pm UTC](https://www.ruby-forum.com/t/params-not-getting-posted/102197/7 "2006-08-12T23:03:49Z")

</div>

my results are different between the production (seperately hosted) site  
and the development site which is local to myself.

here is a tail of the various logs. First selecting the loging link  
then the stats link. All I’ve done is change the controller and action  
parameters.

On the Production host… first :controller=\>‘account’, :action=\>‘login’  
then :controller=\>‘stats’, :action=\>‘new’

Processing AccountController#login (for 24.130.33.165 at 2006-08-12  
13:57:51) [POST]  
Session ID: 112649adcdb5ca0c290e549fb87120b9  
Parameters: {“action”=\>“login”, “controller”=\>“account”, “null”=\>“”}  
Rendering account/login  
Completed in 0.05741 (17 reqs/sec) | Rendering: 0.01350 (23%) | DB:  
0.03850 (67%) | 200 OK

Processing StatsController#new (for 24.130.33.165 at 2006-08-12  
13:59:28) [GET]  
Session ID: 112649adcdb5ca0c290e549fb87120b9  
Parameters: {“action”=\>“new”, “controller”=\>“stats”}  
Completed in 0.01058 (94 reqs/sec) | DB: 0.00213 (20%) | 200 OK  
[[http://thezuke.net/stats/new](http://thezuke.net/stats/new)]

* * *

on the development host everything works fine. I have the same version  
of ruby and rails on both machines.

Processing AccountController#login (for 127.0.0.1 at 2006-08-12  
14:02:11) [POST]  
Session ID: e5a8904dd66379df002779de8a2afcd8  
Parameters: {“action”=\>“login”, “controller”=\>“account”}  
User Columns (0.000674) SHOW FIELDS FROM users  
SQL (0.000944) SELECT count(\*) AS count\_all FROM users  
Rendering account/login  
Completed in 0.02595 (38 reqs/sec) | Rendering: 0.00496 (19%) | DB:  
0.00162 (6%) | 200 OK

Processing StatsController#new (for 127.0.0.1 at 2006-08-12 14:03:19)  
[POST]  
Session ID: e5a8904dd66379df002779de8a2afcd8  
Parameters: {“action”=\>“new”, “controller”=\>“stats”}  
User Load (0.000844) SELECT \* FROM users WHERE (users.id = 1) LIMIT  
1  
Rendered stats/\_newStatInfo (0.02914)  
Completed in 0.05540 (18 reqs/sec) | DB: 0.00084 (1%) | 200 OK
