dimanche 26 mars 2017

Rails nested layout routes

I have the base default layout application.html.erb which all the other pages are rendered into. Now I would like to do sort of the same thing for the users page.

Let s say I have /users/1/about which would be like the root page for the show method:

I have some sort of sidebar and by clicking on links I want some of the content to change. (about/interests/...)

For example the base layout for show would be:

application.html.erb > show.html.erb > about.html.erb

In show I would have something like:

<div class="col-xs-4">sidebar</div>
<div class="col-xs-8"> yield </div>

I assume that this would be somehow possible.

Aucun commentaire:

Enregistrer un commentaire