Questions tagged [iron-router]

A Meteor smart package for client and server side routing in Meteor.

Iron Router is a routing package for Meteor. It makes single page apps.

IR takes control of your tag, rendering templates based on the user's current URL. It also helps you set up subscriptions per-route and much more.

Iron Router works with Meteor 0.8.0 and above.

More information available here

1663 questions
9
votes
3 answers

Using Iron Router to waitOn subscription that's dependent on data from a doc that will come from another subscription

I'm having trouble configuring the waitOn portion of a route where one of the subscription's parameters is determined by the value from a doc that comes from a different subscription. The collections in play are Candidates and Interviews. An…
Craig M
  • 5,446
  • 4
  • 29
  • 42
9
votes
2 answers

Meteor.user() on iron-router server side

How can check, on server side route, if user is logged? I would add check on 'before', but Metor.user() don't work here. thanks in advance. p.s. I have found How to get Meteor.user() to return on the server side?, but not work on iron-router
elbowz
  • 517
  • 1
  • 4
  • 19
8
votes
3 answers

Route to the new data submitted by Meteor autoform using iron router?

I'm using Meteor with AutoForm & Iron Router. I have an autoform for inserting a data, and I want to redirect to the page of the data I added after a successful insert. How should I do it? Here is the For: {{#autoForm collection="Products" id="add"…
user1909176
  • 115
  • 6
8
votes
2 answers

How to get rid of Iron Router splash page

I have a Meteor app and I'm using the iron:router package. Both when I deploy to meteor.com and when I'm developing locally, an iron router splash page shows up on the page with the line "Organize your meteor application". How can I get rid of this?…
Joshin
  • 279
  • 1
  • 3
  • 13
8
votes
1 answer

How to add/edit users with meteor accounts and autoform

I am building part of an admin system in Meteor that lets admins add/edit other admins. I am using Meteor Accounts and Autoform, but I can't figure out how to handle it so the users are validated with Autoform and saved properly. From what i've…
8
votes
1 answer

Totally confused about this.next() in Meteor iron-router

I upgraded to Meteor 1.0, installed the latest iron-router package, tried to run my app and got this nice warning in my console log: Route dispatch never rendered. Did you forget to call this.next() in an onBeforeAction? So I tried to modify my…
user3475602
  • 1,167
  • 2
  • 18
  • 41
8
votes
1 answer

How to do a meteor iron router server side redirect?

Given something like Router.route('/blah/:stuff', function () { // respond with a redirect }, {where: 'server'}); How to do the redirect? is there something built in? or do I have to craft it myself? This is using Meteor 1.0 / Iron Router 1.0
Keith Nicholas
  • 41,161
  • 15
  • 82
  • 145
8
votes
1 answer

Should I Provide Data In Routing Logic or Meteor Template Helper?

Example: I am writing a Meteor app that deals with a list of blog posts. All blog posts are stored in a collection called 'Posts'. I use Iron Router for routing. I want to show the user a list of all the posts created by a particular author. This…
tomet
  • 2,256
  • 3
  • 27
  • 42
8
votes
1 answer

Meteor Iron Router - Router.go callback possible?

I've got a link that I want the user to press. When they press it, the router will go to a certain template and then run Smoothscroll.js code to animate and scroll down to the anchor tag. //When the user clicks on the link to get to the…
fuzzybabybunny
  • 4,858
  • 5
  • 28
  • 53
8
votes
2 answers

Meteor Iron-router server-side only route how to get the current user?

For a server-only route, How can I get the current user. Please note this is a route that looks like: this.route('report_access', { path: '/report/:humanId?/:reportKey', where: 'server', action: .... }); This is not in a…
Pat
  • 5,601
  • 5
  • 31
  • 50
8
votes
3 answers

How to redirect after user has just logged in or just logged out

It seems Deps.autorun is the way to go but Router.go doesn't seem to work within Deps.autorun.
lleonard188
  • 87
  • 1
  • 5
8
votes
2 answers

How to properly replace this.stop() with pause() on Iron Router blaze integration

When I upgrade Iron Router to blaze integration branch, I began receiving this warning: "You called this.stop() inside a hook or your action function but you should use pause() now instead" Chrome console --> iron-router.js:2104 -->…
sergi
  • 135
  • 5
8
votes
1 answer

How do I access HTTP POST data from meteor?

I have an Iron-router route with which I would like to receive lat/lng data through an HTTP POST request. This is my attempt: Router.map(function () { this.route('serverFile', { path: '/receive/', where: 'server', action: function ()…
gozzilli
  • 6,931
  • 6
  • 49
  • 80
7
votes
1 answer

Meteor.user() returns undefined after page reload

Thing is I want to check if the user is is logged in via Meteor.user() within onBeforeAction in my routes. Problem is, after a page reload Meteor.user() returns undefined for a split second before it gets loaded. Here my route…
Matthias Posch
  • 507
  • 6
  • 27
7
votes
2 answers

How do I reload the current iron:router route?

If I'm currently at /foo, Router.go '/foo' does nothing. I would like /foo's action hooks and rendering to be redone. I know I could make a dependency, mention it in an action hook, and invalidate it when I need to reload, I'm just hoping there's a…
Loren
  • 11,184
  • 6
  • 40
  • 67