Forum: Ruby on Rails Action working in local, not working once deployed

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.
C7ce3af7050f4580f56654aa6d52a36e?d=identicon&s=25 Tranquiliste (Guest)
on 2009-01-19 17:07
(Received via mailing list)
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
C7ce3af7050f4580f56654aa6d52a36e?d=identicon&s=25 Tranquiliste (Guest)
on 2009-01-19 22:48
(Received via mailing list)
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| -%>
C7ce3af7050f4580f56654aa6d52a36e?d=identicon&s=25 Tranquiliste (Guest)
on 2009-01-19 23:15
(Received via mailing list)
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 !!!!
This topic is locked and can not be replied to.