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
29
votes
3 answers

How to serve static content (images, fonts etc.) using iron router

I just started working with iron router on meteor. I need to show an image on homepage. I was able to configure route for 'home' using the client side routing. For static files I tried to google and found that adding a server side route might help.…
Goje87
  • 2,559
  • 6
  • 26
  • 45
29
votes
3 answers

How to pass a parameter to pathFor in Handlebars for Iron-Router with Meteorite?

I have a simple route with a parameter: this.route('article', { path: '/article/:_id', data: function() { return Articles.findOne(this.params._id); } }); I would like to have use the pathFor handlebars helper here with the…
Chet
  • 14,628
  • 14
  • 57
  • 101
27
votes
8 answers

How to get the query parameters in Iron-router?

I am trying to get the query parameters in the url. There doesn't seem to be an easy way to do this... which leaves me with the feeling that I must have missed a something in the doc.
Pat
  • 5,601
  • 5
  • 31
  • 50
23
votes
4 answers

How to check for Route through route name in template with Meteor and Iron Router

What can I use in a template to figure out the route name that is associated with the route that I am currently on? For example if I configured a route like so in iron-router this.route('quick', { path: '/wow/:_id', template:…
Maaz
  • 3,833
  • 6
  • 28
  • 49
22
votes
4 answers

Redirect after Login using Meteor and Iron Router

I'm using the built in loginButtons options with Meteor and I would like to redirect after a user logs in. Using the built in web snippets means I can't use the callback with Meteor.loginwithPassword and I can't see any hooks inside Iron-Router to…
user2243825
  • 255
  • 1
  • 2
  • 6
20
votes
1 answer

Meteor v 1.0 and Iron:Router

Is anyone else getting the following error from Iron-Router since upgrading Meteor to version 1.0? Please post here if you know how to resolve this issue. Route dispatch never rendered. Did you forget to call this.next() in an…
meteorBuzz
  • 2,615
  • 4
  • 26
  • 55
20
votes
5 answers

Redirecting not logged-in users with iron-router... Again

I am fighting with the common need for redirecting a user to a login page if he is not logged-in (Meteor v0.8.0 on Windows 7). There are several similar questions on stackoverflow, but no answer seems to work for me. Won't work #1: render() From the…
steph643
  • 2,045
  • 1
  • 18
  • 17
19
votes
1 answer

Meteor|iron-router|what is the differences between Router.map and Router.route

As mentioned above, what is the differences between Router.map and Router.route in using meteor iron-router package? In this tutorial, using 'Router.route'. But in this tutorial, using 'Router.map'. So what is the situation that I use 'Router.map'…
ablian
  • 193
  • 1
  • 5
18
votes
3 answers

middleware_stack.js:31 Uncaught Error: Handler with name 'route' already exists. Iron router Meteor

My code was working fine until last night and suddenly I am getting this error and routes are not working at all. middleware_stack.js:31Uncaught Error: Handler with name 'route' already exists. for simple routes like…
Bipin Bhandari
  • 2,656
  • 20
  • 38
17
votes
1 answer

Meteor crashing Safari

I've run into an incredibly ridiculous bug in my meteor app. Essentially, I have a particular page, that renders a few templates, that crashes Safari on a Mac, and only Safari (and only when the console is NOT open). I've narrowed it down…
maximo
  • 1,091
  • 9
  • 16
15
votes
1 answer

How to serve a file using iron router or meteor itself?

I'm trying to serve a zip file on my Meteor app but I'm stuck. After a lot of Googling it seems the best way to go is with Iron Router but I don't know how: Router.map -> @route "data", where: 'server' path: '/data/:id' action: -> …
Manuel
  • 8,676
  • 12
  • 47
  • 79
14
votes
2 answers

Meteor Iron Router get Current Path from Route with Parameters in a Template Helper

In a Template Helper I get the current path from Iron.Router (iron:router) as follows: Router.current().route.path() This works fine, unless the route path does contain parameters (e.g. /client/:_id/edit). In that case the path() function returns…
Rico Leuthold
  • 1,865
  • 4
  • 32
  • 47
12
votes
3 answers

Meteor - Publish just the count for a collection

Is it possible to publish just the count for a collection to the user? I want to display the total count on the homepage, but not pass all the data to the user. This is what I tried but it does not work: Meteor.publish('task-count', function () { …
Jonathan Sutherland
  • 785
  • 1
  • 7
  • 16
12
votes
3 answers

Meteor.js Spiderable and Iron Router - fiber error on production server

I'm having trouble getting Iron Router and Spiderable working together nicely in my Meteor.js app. If I test a url with ?_escaped_fragment_= whilst running on my localhost it all works correctly but as soon as i push to our DigitalOcean production…
Rik Nauta
  • 229
  • 2
  • 7
12
votes
2 answers

Meteor Iron Router : Passing data between routes

How do I pass data between two different routes and templates? I have a javascript file on the front end (client folder) that simply calls Router.go() passing in the post ID as one of my parameters. Below are the three main culprits (I believe).…
Free Lancer
  • 992
  • 2
  • 15
  • 32
1
2 3
99 100