mongodb - Meteor Routing and subsequent data order -


i got stuck @ understanding meteor routes , data flow.

in beginning simple blog app, 1 collection named posts.

now want store history of changes, i've created second collection , named history.

on every edit in posts i'm adding state of post (author,content, etc ...) history including id of edited post.

question how should configure iron router make pass current post id posts/:_id/history previous state (posts/:_id/) , entries history matching id?

to pass id 1 view next, can via template so:

<a href="/posts/1/history>post history</a> 

or

<a href="/posts/{{_id}}/history>post history</a> 

or programmatically so:

router.go('posthistory', {_id: 1}); 

to history entries, can resolve data in iron router during route request so:

this.route('posthistory', {   path: '/posts/:_id/history',   data: function() {     return history.findone({postid: this.params._id});   } }); 

Comments

Popular posts from this blog

How to provide Authorization & Authentication using Asp.net, C#? -

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

How to use Authorization & Authentication in Asp.net, C#? -