This is set to a layered dispatching mode
i want the API function find_all_orders to call an existing function in app/controllers/order_controller.rb allowing this API function to modify the states in the order_controller
any ideas?
app/controllers/backend_controller.rb
class BackendController < ApplicationController
web_service_dispatching_mode :layered web_service :order, OrderService.new web_service_scaffold :invoke
end
app/apis/order_service.rb Ask is a Model I have in my project
class OrderApi < ActionWebService::API::Base api_method :find_all_orders, :returns => [[Ask]] end
class OrderService < ActionWebService::Base
web_service_api OrderApi
def find_all_orders asks = Ask.find(:all) pp asks asks end end