How to use the same template for different methods in the controller ?

I have a controller with methods index home

Now even though both of them generate different data, the html template they use is exactly the same and in future also all the changes need to be reflected in both of them.

How do I avoid having index.hb.html and home.hb.html and have just one single template ?

4 Replies
  • @Akshar,

    You can always force to use a particular view/template by passing view->name as part of the second argument (called meta) when calling ac.done:

    ac.done(data, { view: { name: 'foo' // where no matter what action triggers this, the view will be foo.hb.html } });

    @joe, can you add this question to the FAQ section?

    Best Regards, Caridy

  • Thank You!

    If there was any way to contribute I would have loved to contribute Mojito documentation.

  • @Akshar, Docs are also part of our Repo (https://github.com/yahoo/mojito/tree/develop/docs). Feel free to issue a pull request :)

  • Oh Cool. Will surely do that.


Recent Posts

in Yahoo! Mojito