私はURLを持っています:http://api.mysite.com/api/v3/publishers/somepublisher.json?callback=mysite.publisherLoaded
そして私はそれにアクセスするためにどのメソッドが呼び出されているかを追跡しようとしています。publisherLoaded
応答は、コールバックでラップされたJSON文字列です。
誰かがこれを追跡し始める方法について私を導くことができますか?
私routes.rb
はかなり大きいので、関連するセグメントを貼り付けました。
API_OPTIONS = {:requirements => {:api_version => /v(1|2|3)/}} unless Object.const_defined?(:API_OPTIONS)
ActionController::Routing::Routes.draw do |map|
map.namespace :api, API_OPTIONS.merge(:path_prefix => '/api/:api_version') do |api|
api.resources :apps, :member => {:authenticate => :get}
api.resources :foreign_currencies
api.resources :designers
api.resources :publishers, API_OPTIONS.merge(:has_many => [:user_sessions, :products], :member => {:login => :get, :authenticate => :get}) do |publisher|
publisher.resources :app_earning_constraints
publisher.resource :charts, API_OPTIONS
publisher.resource :reports, API_OPTIONS
publisher.resources :rules, API_OPTIONS
publisher.resources :sales, API_OPTIONS.merge(
:collection => { :current => :get }
)
# Generic App Scoped Services
map.namespace :api, API_OPTIONS.merge(:path_prefix => '/api/:api_version/app/:app_id', :name_prefix => 'api_app_') do |api|
api.resources :publishers, API_OPTIONS.merge(:has_many => [:aisles], :member => {:login => :get}) do |publisher|
publisher.resources :users, API_OPTIONS.merge(:member => {:authenticate => :post}) do |user|
user.resource :app_state, API_OPTIONS.merge(:controller => 'user_app_states')
# Used to generate a session from OAuth data (OpenSocial integrations)
user.resources :sessions, API_OPTIONS
end
publisher.resources :application_events,
:as => 'events',
:only => :none,
:collection => { :install => :post, :uninstall => :post }
publisher.resources :credit_transfer_pricepoints, API_OPTIONS
end
end
end
# Dynamic javascripts
map.connect 'javascripts/*javascript.plain.js', :controller => 'javascripts', :action => 'show', :format => 'js', :requirements => {:javascript => /#{Dir['app/views/javascripts/**/*.js.erb'].map {|s| s[22..-8]} * '|'}/}
map.connect 'javascripts/*javascript.js', :controller => 'javascripts', :action => 'show', :format => 'js', :requirements => {:javascript => /#{Dir['app/views/javascripts/**/*.js.erb'].map {|s| s[22..-8]} * '|'}/}
# Administration Site
map.with_options(:controller => 'admin/site') do |admin_site|
admin_site.admin_default 'admin', :action => 'index'
admin_site.admin_home 'admin/home', :action => 'index'
end
map.notfound '*url', :controller => 'error', :action => 'notfound'
end