Issues with dynamic routing using meteor-autoform and iron:router

What I am trying to do is create a form with meteor-autoform that will redirect the user to a newly generated route on submit. My thought process is that I can take the submissions _id and use it for an iron:router parameter. What I have so far looks as followed:

Creation of Form

Submits = new Meteor.Collection('Submits');  Submits.allow({   insert: function(username, doc){     return !!username;   } });  SubmitSchema  = new SimpleSchema({   title: {     type: String,     label: "Title"   },   subject:{     type: String,     label: "Subject"   },   summary:{     type: String,     label: "Summary"   },   author:{     type: String,     label: "Author",     autoValue: function() {       return this.userId   },   autoform: {     type: "hidden"   } },   createdAt: {     type: Date,     label: "Created At",     autoValue: function(){       return new Date()     },     autoform: {       type: "hidden"     }   } });  Submits.attachSchema( SubmitSchema ); 

Routing

Router.route('/submit', {   layoutTemplate: 'submitLayout',   waitOn: function() { return Meteor.subscribe("Submits"); },   loadingTemplate: 'loading' });  Router.route('/submit/:_id', {   name: 'formDisplay',   data: function() {     return Submits.findOne({this.params._id});   } }); 

And then I just have the average publish and find calls. My issues are I'm not sure how to perform the redirect on submit, and I am not sure how to display the form results on the newly generated route.

Any help would be appreciated.

Replay

Category: javascript Time: 2016-07-29 Views: 0

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development

search

Front-end development

Database

development tools

Open Platform

Javascript development

.NET development

cloud computing

server

Copyright (C) avrocks.com, All Rights Reserved.

processed in 0.220 (s). 12 q(s)