SOLVED: Submit page not showing up


I’m learning Meteor by reading the Discover Meteor book and was able to implement posts and comments.

Now, I’m trying to add tags same way posts are implemented.
(Actually I’m going to experiment with many-to-many relations, which is a different topic and I will make another post when I get there.)

I have 2 questions:

  1. It’s not showing the following error when I click on Submit Tag button same way as for Submit Post.

        > Access Denied You can't get here! Please log in.
  2. It’s not showing up submit form when I click on Submit Tag
    button after login.

Regarding the question #1, in routes.js I have:

Router.onBeforeAction(requireLogin, {only: 'tagSubmit'});

Regaring the question #2, in routes.js I have:

Router.route('/tags/submit', {name: 'tagSubmit'});

And my tag_submit.js and tag_submit.html as follows:


<template name="tagSubmit">
    <form class="main form page">
        <div class="form-group">
            <label class="control-label" for="name">Name</label>

            <div class="controls">
                <input name="title" id="title" type="text" value="" placeholder="Name your tag" class="form-control"/>

        <input type="submit" value="Submit" class="btn btn-primary"/>

    'submit form': function (e) {

        var tag = {
            title: $('[name=title]').val()
        };'tagInsert', tag, function (error, result) {
            // display the error to the user and abort
            if (error)
                return alert(error.reason);
            Router.go('tagPage', {_id: result._id});

Deployed at
Repo (tags branch)



Haven’t looked in details yet, but it fixed when I create tags related stuff from scratch, so we can this consider as Solved.