batman.js

Using jQuery with Batman.js

房东的猫 提交于 2019-12-23 19:18:03
问题 I'm experimenting with Batman.js and I'd like to use jQuery with it for some standard Ajax and animation features. I'm following the installation instructions located at http://batmanjs.org/download.html and at the bottom of the page there's a short description about how to use the jQuery adapter that I do not really understand how to setup. I see some of the files listed at https://github.com/Shopify/batman/tree/master/lib but I'm not sure where they go and how to set that up. Any advice on

Batman.js: Related model undefined for polymorphic association not found

百般思念 提交于 2019-12-08 13:09:37
问题 I'm running into an issue trying to implement polymorphic associations on a Batman model. I'm getting this error in the console: Related model undefined for polymorphic association not found. I'm having a hard time tracking down where I am going wrong. Where should I look to find the missing piece? My models look something like this: class Admin.Product.PopularCollectables extends Batman.Model @belongsTo 'collectable', polymorphic: true class Admin.Item extends Batman.Model @hasOne 'popular

406 error when responding with json

◇◆丶佛笑我妖孽 提交于 2019-12-04 20:27:29
问题 I'm trying to get a rails app running with the node.js framework batman.js via the batman-rails gem. When I'm responding with json in my rails controller, I get a 406 error everytime, and I don't know why. Here's my controller: respond_to :json def index respond_with Sample.all end This gives me a 406 no matter what. I do not think this is related to batman, but rails itself. But for good measure, here's my batman code: index: (params) -> TopNavTemplate.Sample.load (err) -> throw err if err

406 error when responding with json

二次信任 提交于 2019-12-03 13:22:49
I'm trying to get a rails app running with the node.js framework batman.js via the batman-rails gem. When I'm responding with json in my rails controller, I get a 406 error everytime, and I don't know why. Here's my controller: respond_to :json def index respond_with Sample.all end This gives me a 406 no matter what. I do not think this is related to batman, but rails itself. But for good measure, here's my batman code: index: (params) -> TopNavTemplate.Sample.load (err) -> throw err if err @set 'samples', TopNavTemplate.Sample.get('all') And then my index.html.erb file simply says 'index', it