0
votes

I've been trying to get this button to take me to a route called 'manage'. But somehow the data I'm passing with the {{#link-to}} does not seem to work.

router.js

  this.route('manage', {path: '/:stack_id/manage'});

main.hbs

<div class="row">
    <div class="pull-right">
    {{#link-to "manage" list}}
    <button class="btn-gray"> Manage People {{fa-icon "coffee"}}</button> 
    {{/link-to}}
    </div>
</div>

main.js where {path: '/:stack_id'}

import Ember from 'ember';

export default Ember.Route.extend({
    model: function(params) {
        return this.store.find('list', params.stack_id);
    },

I've tried replacing {{#link-to "manage" list}} with list.id and model.id, both of these brings the message that

"This link-to is in an inactive loading state because at least one of its parameters presently has a null/undefined value, or the provided route name is invalid.

1

1 Answers

0
votes

You need to pass model.id to link-to helper but model can't be null. Make sure param is defined when you call store.find method and API returns correct response/record is found. You can use {{log model}} to check if model is defined in your template.