views:

22

answers:

1

I have a Flex front end and a Rails 3 back-end that I would like to establish a session to. Before you can access the page embedded with the flex front-end, you are prompted with a html login page through Devise.

I am able to login fine through the html page but cannot get access to the session with Flex using amf requests.

I have the rails session token in flex but cannot pass them into rails correctly. I am attempting to pass the sessiontokin in through a "send" service call like

somethingService.new.send(session_id: '###', _csrf_token: '###' )

and rails is receiving the session param in a hash as like

{0=>{"session_id"=>'###')}} 

instead of like

{"session_id"=>'###')}.

Any suggestions on how to fix this issue or to utilize a session with Flex/RubyAmf/Rails are welcomed.

Thx.

A: 

It's been a while since I've done anything with integrating flex & rails, but I have a vague memory that the params come through as {0 => params} if not explicitly mapped in the configuration. The rails3-amf readme on github uses this example:

config.rails3amf.map_params :controller => 'UserController', :action => 'getUser', :params => [:session_id]

If your not already, perhaps explicitly defining the session_id in the :params would make the difference?

njorden
I am currently explicitly defining the session_id in the :params with no luck.
Joey