views:

30

answers:

0

I'm renovating an application to work through AJAX. Unfortuantely, the action url in my form is getting messed up somehow. Do you know why this is?

Currently my swfupload param of :

upload_url: $('#new_video').attr("action"),

is returning a

SWF DEBUG: Event: uploadError: HTTP ERROR : File ID: SWFUpload_0_0. HTTP Status: 302.

SwfUpload depends on an upload_url to designate where the files are sent to. I looked at what the upload_url is via Firebug. On my working production it shows this :

>>> $('#new_video').attr("action")
"/organizations/470/media/videos"

On my broken testing server it shows this :

>>> $('#new_video').attr("action")
"/organizations/1/media/videos?_hq_channel_session=BAh7CjoQX2NzcmZfdG9rZW4iMTVrM3NyWkMzVGk5OGJFNXR6WTZ1V3djWWtyUThnS01OaFlDZVBsUzA5SEU9IhV1c2VyX2NyZWRlbnRpYWxzIgGAODQ4NjQwMzViZTNkODkyYmQ1NmNkY2U3ZTcxOTBhYzc2ZGFhMWNlMGQ0ZjVhOGFlMDZjODUyZGU5N2MzMzM5MGFhOTRkNmZlNmNhMGQ1N2Y3YmU4NzY2OWJjYzk1ZDhiOWVkNzQ3OGQxOTJjMGViMDdiZWQ1MGI0NmZhODQ4YWUiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhhc2h7BjoLbm90aWNlIhVMb2dpbiBzdWNjZXNzZnVsBjoKQHVzZWR7BjsHRiIYdXNlcl9jcmVkZW50aWFsc19pZGkGOg9zZXNzaW9uX2lkIiVkOTgyODQxMGQ4ZmIwYmQ5NjE0MzJmZjk3M2QwYTU0Ng%3D%3D--cec22d577c7cca009b91847175645cc0ebd65c5b&authenticity_token=5k3srZC3Ti98bE5tzY6uWwcYkrQ8gKMNhYCePlS09HE%3D"

.

Lots of garbledy that otherwise isn't shown on the working server.

Here is where all the garbledy comes from :

.

form

- form_for [@organization, @video], :url => organization_media_videos_with_session_path(@organization), :html => { :multipart => true } do |f|

form_helper

def organization_media_videos_with_session_path(organization)
  session_key = ActionController::Base.session_options[:key]
  organization_media_videos_path(organization, session_key => cookies[session_key], request_forgery_protection_token => form_authenticity_token)
end