iron-router

Meteor 1.0 - Passing a parameter into pathFor using iron:router

偶尔善良 提交于 2020-02-23 07:36:32
问题 I've seen a few answers on how to pass a parameter using iron:router as the third parameter, for example: href="{{pathFor 'article' _id=this._id }}" What I would like to do is pass a parameter as the second variable (where 'article' is in the example above). I have a collection of posts that contain a title , a body , and a type . There are three types of articles in the project I'm working on, and each type needs to be routed to a different template because the formatting is significantly

Meteor 1.0 - Passing a parameter into pathFor using iron:router

自古美人都是妖i 提交于 2020-02-23 07:36:08
问题 I've seen a few answers on how to pass a parameter using iron:router as the third parameter, for example: href="{{pathFor 'article' _id=this._id }}" What I would like to do is pass a parameter as the second variable (where 'article' is in the example above). I have a collection of posts that contain a title , a body , and a type . There are three types of articles in the project I'm working on, and each type needs to be routed to a different template because the formatting is significantly

Uncaught Error: No Iron.Layout found so you can't use yield

江枫思渺然 提交于 2020-02-21 13:03:56
问题 Using Meteor 0.9.3 and iron:router 1.0.0-pre2, this error shows on the console even though iron:layout was installed, see below: willems-mini:iron willem$ meteor add iron:router@=1.0.0-pre2 added iron:location at version 1.0.0-pre2 added iron:dynamic-template at version 1.0.0-pre2 added iron:router at version 1.0.0-pre2 added iron:layout at version 1.0.0-pre2 added iron:middleware-stack at version 1.0.0-pre2 added iron:url at version 1.0.0-pre2 added iron:controller at version 1.0.0-pre2

Uncaught Error: No Iron.Layout found so you can't use yield

旧城冷巷雨未停 提交于 2020-02-21 12:56:19
问题 Using Meteor 0.9.3 and iron:router 1.0.0-pre2, this error shows on the console even though iron:layout was installed, see below: willems-mini:iron willem$ meteor add iron:router@=1.0.0-pre2 added iron:location at version 1.0.0-pre2 added iron:dynamic-template at version 1.0.0-pre2 added iron:router at version 1.0.0-pre2 added iron:layout at version 1.0.0-pre2 added iron:middleware-stack at version 1.0.0-pre2 added iron:url at version 1.0.0-pre2 added iron:controller at version 1.0.0-pre2

Iron router onBeforeActions is redirecting to startpage

这一生的挚爱 提交于 2020-02-06 03:47:29
问题 I use onBeforeActions to check if users are logged in, if their profile is incomplete or disabled. This seems to work correctly. But now the problem is whenever I directly go to a page within the app, I get redirected to startPage as well. I debugged and discovered 'user' is undefined, although I'm logged in. I use accounts-fb & -tw and account-ui packages. How can I make sure the user is logged in? I don't understand the correct timing of the functions.. edit: Locally I don't always seem to

Iron Router with multiple parts

自闭症网瘾萝莉.ら 提交于 2020-01-17 01:45:13
问题 I am using Meteor iron:router. I have a template called by the name 'multi'. So whenever I have paths like '/multi' or '/multi/BSC123' , I want 'multi' to be rendered. So far I have used an array approach like this Router.route('multi',{ path:['/multi','/multi/:_id'] }); This works fine. But when I use this approach, my left nav bar which has a href link to 'multi' template is not shown. So apart from the above approach, can anyone suggest me other solution where I can have two paths and same

Iron Router / Meteor - Post details with username in URL

社会主义新天地 提交于 2020-01-17 01:21:13
问题 I'm relatively new to Meteor (especially Iron Router), and have been stuck on the following issue... I have a route which displays details about a single post: this.route('singlePost',{ path:'/posts/:_id', data:function(){ return Posts.findOne(this.params._id); } }); This works fine, but I'd like to be able to show the post owner's username in the URL, rather than the static "/posts/" path, ex: this.route('singlePost',{ path:'/:username/:_id', data:function(){ return Posts.findOne(this.params

Meteor iron-router set route for overlay

我的未来我决定 提交于 2020-01-15 05:25:12
问题 I wanted to implement the overlay effect like Atmospherejs.com by iron-router when overlay has the specific route (https://atmospherejs.com/?q=). Does anyone have any idea? 回答1: It doesn't have route, by the way. As you can see nothing between domain name and query parameter. and It just triggering of UI element on some click. Something like following from CodeDrops might help for your usecase - Demo here: http://tympanus.net/Development/FullscreenOverlayStyles/index5.html Code for same and

Preventing access to a page in Meteor

故事扮演 提交于 2020-01-07 03:25:28
问题 I am building an app in meteor in which one of the pages is visible to user only if the user is logged in. The link to the page is in the navigation header and I want a login dialog to be displayed when the user clicks on the link without logging in. Here is the code for showing the dialog : <template name="header"> <a href="#" id="createPost">Create Post</a> </template> Template.header.events({ "click #createPost": function (evt) { evt.preventDefault(); if(!Meteor.user()) { $('#myModal')

POST from Ruby to Meteor with Iron Router?

一曲冷凌霜 提交于 2020-01-06 19:27:41
问题 I've been trying to get a message from a Ruby script to a webapp built with MeteorJS using POST, but I've been facing some issues. There isn't much documentation online about POST and GET method management with Iron Router. My Ruby script: meteorUri = URI('http://localhost:3000/newReport'); res = Net::HTTP.post_form(meteorUri, 'message' => 'HelloFromRuby', 'max' => '50') puts "From Meteor:\t#{res}" I don't have much experience with Ruby. The above code I got mostly online. The routing with