How do I create a model inside an unrelated route/template?


#1

Say currently I have a route and template called Newsfeed. This is where all the newsfeed items are currently displaying.

However, if I want to include a text field at the top with a submit button, like Facebook’s current ‘what’s on your mind?’, with the text field mapping to the Note model, and a separate backend API endpoint, how should I do it?

I’ve tried using controllerFor inside the Newsfeed route to setup the reference to my Note model, and I’ve tried creating another template within the Newsfeed index template, but it doesn’t seem to work.

Any general advice to point me in the right direction would be much appreciated… thanks! :smile: