0

I am following the guide of integrating Spine.js with Rails 3.

I created a model Activity and follow the spine.js guide to try it out. When I tried to create an activity I got this error:

POST http://localhost:3000/activitys 404 (Not Found)

Clearly it's not pluralize the model name for the route, is it fixable from spine.js side?

larryzhao
  • 3,173
  • 2
  • 40
  • 62

1 Answers1

0

You can specify the model's endpoint URL in Spine if the URL Spine guessed is not the correct one. Put the following inside your activity.js.coffee file:

    class App.Activity extends Spine.Model
        @url: '/activities'

That should make Spine hit the proper endpoint.

fholgado
  • 390
  • 2
  • 10