I have a Ruby on Rails 3 news application. This requires a headline, some content, and an image attachment (using a clip recorder). I use the RABL gem to provide a Sencha Architect project with a JSON feed .
The problem is that Sencha Architect cannot read JSON URLs. When I try to load data into the storage, I get a very useless message: "Unable to load data using the supplied configuration" and a link to open the URL in the browser (which opens just fine). Does the Sencha archive have a log somewhere that provides additional information about this error?
Here are the RABL files:
# show.rabl object @article attributes :title, :body node(:mobile_url) { |article| article.image.url(:mobile, false) } node(:tablet_url) { |article| article.image.url(:tablet, false) } node(:original_url) { |article| article.image.url(:original, false) }
RABL does not provide a default content type, so I have this in the article controller:
before_filter :default_format_json def default_format_json if(request.headers["HTTP_ACCEPT"].nil? && params[:format].nil?) request.format = "json" end end
This is the code created by the architect to show the configuration options that I used:
# Stories store Ext.define('MyApp.store.Stories', { extend: 'Ext.data.Store', requires: [ 'MyApp.model.Story' ], config: { autoLoad: true, model: 'MyApp.model.Story', storeId: 'Stories', proxy: { type: 'jsonp', url: 'https://feedr.org.uk/articles.json', reader: { type: 'json', rootProperty: 'article' } } } });
How can I get Sencha Architect to read my JSON data? Any help you can provide is greatly appreciated.