Created
March 23, 2012 02:05
-
-
Save kennym/2166185 to your computer and use it in GitHub Desktop.
Sencha Touch JSON-P and Ruby on Rails
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SampleController < ApplicationController | |
respond_to :json | |
def index | |
@nodes = Node.all | |
render :json => @nodes.to_json, :callback => params[:callback] | |
end | |
end | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ext.define('App.store.SampleStore', { | |
extend: 'Ext.data.Store', | |
requires: [ | |
"Ext.data.proxy.JsonP" | |
], | |
config: { | |
model: 'App.model.Sample', | |
autoLoad: true, | |
proxy: { | |
type: 'jsonp', | |
url: 'http://www.example.com/nodes.json', | |
reader: { | |
type: "json", | |
rootProperty: "" | |
} | |
}, | |
} | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment