I'm using Ember 1.0 and Ember-Data1.0beta. Typically, Ember knows what URL to submit a resource to because in the route you define the model. For instance:
model: ->
@store.createRecord('organization')
or:
model: (params) ->
@modelFor('organization')
What do you do if the form isn't tied to the route? Specifically, I have a list of comments, each of which has two forms, an up-vote form and a down-vote form. These are rendered through a component like so:
// comment.emblem
. . . .
poll-vote commentId=comment.id
. . . .
// components/poll-vote.emblem
form submit='up-vote'
input type="hidden" valueBinding="commentId" value=commentId
input type="hidden" valueBinding="value" value="1"
Whistlr.Button
form submit='down-vote'
input type="hidden" valueBinding="commentId" value=commentId
input type="hidden" valueBinding="value" value="-1"
Whistlr.Button
How can I get Ember to submit these forms to the route /votes? I know this is possible with some hand-coded AJAX, but I suspect there some way to get Ember's store to do so.