Before_filter in actionwebservice controller using direct di

The docs say that for direct dispatching mode to use controller
filters, but when the controller is run I get the following error.
The authorize method is in application.rb. Works fine when it’s not a
web service api. Should I be using before_invocation instead even
with direct dispatching mode? Or can I not have the authorize method
in application.rb?

undefined method `authorize’ for #CustomerController:0x8ee54e0

class CustomerController < ActionController::Base
after_filter :end_session
before_filter :authorize
web_service_dispatching_mode :direct
web_service_scaffold :invoke
web_service_api CustomerApi
end

Chris

Ok I see why it’s not working, since I’m using ActionController::Base.
But where is the appropriate place to do stuff that you would
normally do in application.rb like requiring additional modules,
setting session preferences, class variables, methods needed by all
controllers, etc?

Chris

Argh, never mind damn typo.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs