# Params not parsed correctly from url from observe\_field, (only occurs on new server environment)

**URL:** <https://www.ruby-forum.com/t/params-not-parsed-correctly-from-url-from-observe-field-only-occurs-on-new-server-environment/139042>\
**Category:** Rails\
**Created:** [May 30, 2008, 11:46am UTC](https://www.ruby-forum.com/t/params-not-parsed-correctly-from-url-from-observe-field-only-occurs-on-new-server-environment/139042 "2008-05-30T11:46:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rooster](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/71c47a/32.png) [@rooster](https://www.ruby-forum.com/u/rooster)\
**Post date:** [May 30, 2008, 11:46am UTC](https://www.ruby-forum.com/t/params-not-parsed-correctly-from-url-from-observe-field-only-occurs-on-new-server-environment/139042/1 "2008-05-30T11:46:45Z")

</div>

Greetings 🙂

Anyone see anything obvious or know of any occurrences of this kind of  
issue.

In the process of testing deployment to a new hosting environment we  
found this issue.

this operation works on current production servers  
and on all development machines, so we are kind stumped why the params  
of getting messed up.

Config has been replicated from our existing setup.

this field observer is rendering correctly

\<%= business\_image\_chooser(100, 100, “Choose image”, :id =\>  
‘mini\_job\_ad\_logo\_upload’, :callback\_function =\>  
“select\_mini\_ad\_logo”) %\>  
\<%= observe\_field(“mini\_job\_ad\_logo\_id”, :frequency =\> 1, :url =\>  
{ :action =\> :update\_mini\_ad\_logo},  
:with =\> “‘logo\_id=’ + escape($(‘mini\_job\_ad\_logo\_id’).value) +  
‘&position\_profile\_id=’ + escape($(‘position\_profile\_id’).value)”) %\>  
\<% end %\>

CDATA[\nnew Form.Element.Observer(‘mini\_job\_ad\_logo\_id’

, 1, function(element, value) {new Ajax.Request(’/business/positions/  
job\_ad/update\_mini\_ad\_logo’, {asynchronous

:true, evalScripts:true, parameters:‘logo\_id=’ + escape($  
(‘mini\_job\_ad\_logo\_id’).value) + '&position\_profile\_id

=’ + escape($(‘position\_profile\_id’).value)})})\n//]]

but when the observer submits its ajax request  
the params end up being parsed out incorrectly

Parameters: {“position\_profile\_id”=\>“95”, “action”=\>“job\_ad”,  
“id”=\>“update\_mini\_ad\_logo”, “controller”=\>“business/positions”,  
“logo\_id”=\>“561”}

they should be

Parameters: {“position\_profile\_id”=\>“95”,  
“action”=\>“update\_mini\_ad\_logo”, “controller”=\>“business/positions/  
job\_ad”, “logo\_id”=\>“561”}

so it ends up submitting to the wrong controller thus we get

ActionController::UnknownAction (No action responded to job\_ad):

here are the routes that deals with this section

map.resource :business do |business|  
business.resources :positions, :controller =\> ‘business/  
positions’, :collection =\> {:getting\_started =\> :get, :list  
=\> :get}, :member =\> {:close =\> :put, :extend\_position =\> :put} do |  
positions|  
positions.resource :details, :controller =\> ‘business/positions/  
details’  
positions.resource :hiring\_details, :controller =\> ‘business/  
positions/hiring\_details’  
positions.resource :applicant\_profile, :controller =\> ‘business/  
positions/applicant\_profile’  
positions.resource :package\_preferences, :controller =\>  
‘business/positions/package\_preferences’  
positions.resource :working\_details, :controller =\> ‘business/  
positions/working\_details’  
positions.resource :training\_development\_details, :controller  
=\> ‘business/positions/training\_development\_details’  
positions.resource :job\_ad, :controller =\> ‘business/positions/  
job\_ad’  
positions.resource :posting, :controller =\> ‘business/positions/  
posting’  
positions.resource :management, :controller =\> ‘business/  
positions/management’  
positions.resources :job\_applications, :controller =\> ‘business/  
positions/job\_applications’  
end

The sysadmin and I have been through all the configs and they are  
identical.

The error occurs when going directly to one of the mongrels so i  
believe that rules out any possible apache issues

hope i have been detailed enough here

Cheers  
Steven

/\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*/  
Steven H.  
Programmer, Web D., IT Consultant  
Composer, Producer, Performer, DJ  
p. 0437 541 276  
e. removed\_email\_address@domain.invalid  
/\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*/
