Restful Rails controller for Flex front end

Restful Rails controller for Flex front end

So I have an existing rails app that I've been asked to retrofit to support a flex client. Since I don't really want to muck around with the existing controllers and routes, I thought the best way to accomplish this would be to create a subdirectory in app/controllers called flex and put in some additional controllers in there to handle the flex specific requests.

So basically, instead of a request to /sessions/ [method = POST] I'd want to route /flex/sessions/ [method = POST] to go to my sessions_controller in the flex sub directory. I can get it to go to the correct controller, but it's looking for the idnex method (so it looks like it's treating my request as a GET request even though the log says its a POST request.

Any thoughts on how to add this controller to my routes file to handle the HTTP verbs?

Right now the only addition to my routes.rb has been

map.connect 'flex/sessions/:action', :controller => 'flex/sessions'

Thanks in advance for any help.


Is there native support in Rails or Ruby for representing threaded comments


Stop redirecting to sessions/new?
Try using namespaces..
How do I ignore the authenticity token for specific actions in Rails?
map.namespace(:flex) do |flex|   flex.connect 'sessions/:action', :controller => 'sessions'   #or, ya know, use more restful routes now that you're in /flex/   flex.resources :sessions end 

Changing mocha default expects exactly once

75 out of 100 based on 55 user ratings 855 reviews