Question

I have a model in rails called WorkRequest and the naming conventions in rails give me the create route of work_requests/ [POST]. In Spine with the same model name it posts to the path workrequests/ Is this by design and do I need to override it somewhere.

Out of interest, what do others use as a naming convention when the model name has more than one word in it? Would it have been better to call the mode Workrequest and have done with it?

Was it helpful?

Solution

Ok, I should have kept looking: http://spinejs.com/docs/ajax. I found that you can override the default path by add @url option to the model.

class App.WorkRequest extends Spine.Model
  @configure 'WorkRequest', ... [field list]
  @extend Spine.Model.Ajax
  @url: "/work_requests"

I'm still interested in the diference in naming conventions between Spine and Rails with multiword model names.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top