I would like to give my application 2 different views (HTML, CSS, JS):
- for an unauthorized user (nice looking one)
- only for an authorized user (raw tables with all model data and its available actions buttons)
and make possible for the authorized user to switch between them.
As for now I have 2nd and I'm going to create user authorization (probably with CanCan gem) and then 1st.
guides.rubyonrails.org "2.2.12.2 Choosing Layouts at Runtime" describes nice way to switch between layouts but it's not enough for me I think.
In my case both layouts would look the same or almost the same:
<!DOCTYPE html>
<html>
<head>
# layout depended JS and CSS maybe
</head>
<body class="container">
<%= render 'layouts/navbar' %>
<%= render 'layouts/flash' %>
<%= yield %>
</body>
</html>
What I'm interested in is to decide somehow which folder will be used to fill yield above.
I have slides_controller.rb and /app/views/slides/* and I would like to create one more, let say /app/views/slides_nice/* and use same slides_controller to decide which one should be used for rendering.