Hi,--I'm new to Batman.js so I'm hoping somebody can help me out.
When I call destroy on a model I want it to call a nested url. It seems to work OK when I call save.Here is my class:
class App.Passenger extends Batman.Model@resourceName: 'passenger'@storageKey: 'passengers'@persist Batman.RailsStorage@belongsTo 'booking'@encode 'id', 'first_name', 'last_name', 'weight', 'baggage_weight'@encode 'booking_id', encode: false@encodeTimestamps()@urlNestsUnder 'booking'And here is the code that I have in a view.
removePassenger: (booking, passenger) ->passenger.set('booking', booking)passenger.destroy (err, obj) =>if errthrow err unless err instanceof Batman.ErrorsSetelse@get("controller.booking.passengers").remove(obj)
The call that is made is DELETE http://localhost:3000/passengers/8.json instead of DELETE http://localhost:3000/bookings/1/passengers/8.json.Any help would be appreciated.Andrew
You received this message because you are subscribed to the Google Groups "batman.js" group.
To unsubscribe from this group and stop receiving emails from it, send an email to batmanjs+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.