# Action working in local, not working once deployed

**URL:** <https://www.ruby-forum.com/t/action-working-in-local-not-working-once-deployed/158133>\
**Category:** Rails\
**Created:** [January 19, 2009, 5:07pm UTC](https://www.ruby-forum.com/t/action-working-in-local-not-working-once-deployed/158133 "2009-01-19T17:07:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tranquiliste](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ed655f/32.png) [@tranquiliste](https://www.ruby-forum.com/u/tranquiliste)\
**Post date:** [January 19, 2009, 5:07pm UTC](https://www.ruby-forum.com/t/action-working-in-local-not-working-once-deployed/158133/1 "2009-01-19T17:07:26Z")

</div>

Hello

I have a form (new/create) which works well in local, but not when  
deployed where it keeps being redirected to the index action when I  
submit.  
Here is what I have done so far :

- de-Ajaxified the form to be pure HTML

- put a logger.info on the first line of the create action and  
realised I did not pass through the action

- I have suppressed all the before\_filter actions for this controller  
and the application.rb

- the logs (log\_level :debug) do not show a lot : the new action is  
followed by an index action in the deployed app (the new is followed  
by create [post] in local)

- I have looked at firebug traces and in the deployed environment I  
have  
POST buildings with a 301 moved permanently  
followed by GET buildings  
where in local I have  
POST Buildings with a 200 ok

- With that I have suspected a problem with Restful\_authentication,  
because this is the only thing left that can cause this redirection,  
but I can’t understand why and I don’t know what can I do to diagnose  
further.

- Could it be a problem with the sessions (cookie based) ? I have  
tried with database stored session but it is the same.

- I thought of a reserved word problem but the controller is called  
buildings, and fields names are not reserved words

Notes

- I have also tested the deployed app on a computer which I never used  
before for the app and the problem was the same.
- I have done my deployment with webistrano/capistrano 1.4 on an  
environment called “integration”, I have tried with an ftp deployment,  
but it is the same
- I use a freezed version of rails 2.1.0 (installed ruby is 1.8.6),  
gems are UUID, Will\_paginate and Macaddr
- I can create a user, log in and if I inject data directly in through  
SQL and phpMyAdmin, the other creation form (not building form) seems  
to work.
- I have checked the .htaccess and dispactch.fcgi

Any help to diagnose would be greatly appreciated because I am stuck  
with that and I don’t know what can I do.

Thanks  
Nicolas

---

<div class="post-metadata">

**Author:** ![tranquiliste](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ed655f/32.png) [@tranquiliste](https://www.ruby-forum.com/u/tranquiliste)\
**Post date:** [January 19, 2009, 10:48pm UTC](https://www.ruby-forum.com/t/action-working-in-local-not-working-once-deployed/158133/2 "2009-01-19T22:48:41Z")

</div>

Hello, this is very strange if in my view I replace the ‘create’  
action by another name, it works (i have also modified the controller  
with the same action name of course) !!!  
\<% form\_for :building, :url =\> {:action =\> ‘created’, :controller =\>  
‘buildings’} do |f| -%\>

---

<div class="post-metadata">

**Author:** ![tranquiliste](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ed655f/32.png) [@tranquiliste](https://www.ruby-forum.com/u/tranquiliste)\
**Post date:** [January 19, 2009, 11:15pm UTC](https://www.ruby-forum.com/t/action-working-in-local-not-working-once-deployed/158133/3 "2009-01-19T23:15:46Z")

</div>

More information  
In my original view I had :  
\<% form\_for :building, :url =\> buildings\_path do |f| -%\> #  
The create action worked well locally but not on the server

I tested with :  
\<% form\_for :building, :url =\> {:action =\> ‘create’, :controller =\>  
‘buildings’} do |f| -%\> # I had stil the same problem

But changing the action name like that  
\<% form\_for :building, :url =\> {:action =\> ‘created’, :controller =\>  
‘buildings’} do |f| -%\> # IT WORKS !!! !!! (of course I have also  
changed the action name in the controller)

If someone can explain me, I have spent my weekend trying to find what  
was wrong !!!
