Questions tagged [batman.js]

batman.js is an MVC framework for building rich single-page browser applications. It is written in CoffeeScript and its API is developed with CoffeeScript in mind, but of course you can use plain old JavaScript too.

50 questions
0
votes
1 answer

Data-event-click only called once, why?

I am making a custom widget in Shopify Dashing with the following code:
mpals
  • 121
  • 3
  • 15
0
votes
2 answers

Custom Adapter to support RocketPant with Rails

I am using rocket_pants gem to build backend API https://github.com/Sutto/rocket_pants It have a specific format to output data: { "response":[ {"id":1,"title":"Object Title","description":"Object Description"}, …
Nazar Hussain
  • 5,102
  • 6
  • 40
  • 67
0
votes
2 answers

Has many through self join in batmanjs

I am trying to implement a has many through relationship as elaborated here. However, my related model is the same as the referring model by means of a self-join. I tried this: class Article extends Batman.Model @hasMany 'citations' @hasMany…
Raymundus
  • 2,173
  • 1
  • 20
  • 35
0
votes
2 answers

Accepting Nested Attributes in Batman.js

I have this relationship working using HTML and HTTP, but I'm completely lost as to make this work with Batman.js. I've made a plethora of attempts, but none have been successful. I've also attempted to implement the steps in this guide with no…
tylerkern
  • 121
  • 9
0
votes
1 answer

Issues returning a Request result in Batman.js

I'm having issues returning a result from a Batman.Request call. I've comment the area where I'm calling the return. I'm pretty sure I can't just call return there, but I can't seem to find any documentation that will point me in the right…
tylerkern
  • 121
  • 9
0
votes
1 answer

Self joins in Batmanjs

How can I implement the self-joins in Batmanjs? In rails, as found here, it goes like this: class Employee < ActiveRecord::Base has_many :subordinates, class_name: "Employee", foreign_key: "manager_id" belongs_to :manager, class_name:…
Raymundus
  • 2,173
  • 1
  • 20
  • 35
0
votes
1 answer

Setup, runTests and teardown fails at Batman.TestCase

I am trying to get batman testing up and running. Qunit and tests runs fine, but when i use the example: class SimpleTest extends Batman.TestCase @test 'A simple test', -> @assert true test = new SimpleTest test.runTests() I get the…
Raymundus
  • 2,173
  • 1
  • 20
  • 35
0
votes
1 answer

Batmanjs image upload

I'm using BatmanJs and Rails. I used carrierwave for uploading pictures and all worked fine. But, I am unable to show the image. The model has the attr photo.url which works fine. But I don't know how to bind a image tag. I tried the following,…
0
votes
1 answer

Include batman test_case

I am trying to implement TDD in BatmanJS, but the Batman.TestCase class is an extra. How do i include it from github in my rails app as sugested here?
Raymundus
  • 2,173
  • 1
  • 20
  • 35
0
votes
1 answer

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

I am trying to set up the polymorphic association in Batman as documented here. I am using LocalStorage and keep getting the following message: Related model undefined for polymorphic association not found. My model is a follows: class App1.Model…
Raymundus
  • 2,173
  • 1
  • 20
  • 35
0
votes
1 answer

Batman polymorphic belongs to association

I am trying to set up a polymorphic association for a parent that has multiple different types of children. What I find in the documentation is about the inverse problem: children with different types of parents. I tried the code below, but that…
Raymundus
  • 2,173
  • 1
  • 20
  • 35
0
votes
1 answer

where should I put the jquery call to a plugin inside a Batman.js app?

I have a plugin called select2, I normally invoke the plugin inside my javascript file like this: $(document).ready(function() { $("#e1").select2(); }); but on my Batman app I'm not sure where should I put it. I could place it inside the libs…
Israel Bautista
  • 119
  • 1
  • 9
0
votes
1 answer

Batmanjs testing on Rails with Karma

I'd like to use batmanjs karma and rails on a current project. At the moment I'm attempting to use the batmanjs testing framework, but I'm having a heck of time getting everything to play together. Any help would be…
0
votes
1 answer

What is the NamedRouteQuery for 'index' actions in Batman.js

I am trying to redirect to an index action after save, and can't figure out the proper NamedRouteQuery. I have…
emkman
  • 812
  • 12
  • 21
0
votes
1 answer

Finding records by attribute value in a batman.js and rails 3 app

I have a User model in my app and I would like to "find" a User by the name attribute. I don't believe there is any out-of-the-box support for this in batman.js but it is possible that it is just undocumented. I will also need to make some changes…
wuliwong
  • 4,238
  • 9
  • 41
  • 69