I think you're on the right track; we use:

            request=new URLRequest("/line_items");
            request.method=URLRequestMethod.POST;
            
request.data="authenticity_token="+authenticity_token+"&design_id="+id;
            loader.load(request);

One gotcha I ran into is authenticity_tokens are not URI-safe, which was 
causing intermittent failures for me depending on the value of a given 
authenticity_token.  So when I'm pulling it from the flashvars I do:

var 
authenticity_token:String=encodeURIComponent(parameters["authenticity_token"]);

Glancing at the doc for URLVariables, I don't *think* it does that for 
you; you need to do it yourself.

HTH,

dwh


[email protected] wrote:
> OK I finally am able to get a filereference uploader to send files to
> rails from Flash. I had to turn the auth_token off using:
>
> skip_before_filter :verify_authenticity_token, :only => 'upload_photo'
>
>
> But, for security I want to turn it back on. But I'm unable to get
> Flash to send the vars correctly. I am able to grab the auth token
> with some Javascript and I then use:
>
>
> variables = new URLVariables();
> variables.authenticity_token = paramList["authenticityToken"];
> var request = new URLRequest(UPLOAD_URL);
> request.method = URLRequestMethod.POST;
> request.data = variables;
>
>
> Is that correct? The variable in an html rails form uses the same var
> "authenticity_token" so I would assume it's the same, but it's not
> working.
>
>   

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to