Can you use sessions in layered dispatching? I used them in direct
dispatching without any problems, but switching to layered throws an
error (saying session doesn’t exist).
Sorry if this is a double post, Google G. isn’t posting my message
for some reason.
Thanks!
I did this yesterday, and I tried to raise @controller.session[:user_id]
and it didn’t work. Stupid mistake on my part, raise @controller.session[:user_id].to_s works much nicer
Kent S. wrote:
You can pass the current controller to your service like this
class UserService < AWS::Base
def initialize(controller) @controller = controller
end
def login @controller.session[…]
end
end
class ServiceController < ApplicationController
web_service(:user) { UserService.new(controller) }
end