Reputation: 113
I have more than 1 app that are exaclty the same. The only difference is the layout of these apps. I was looking for a way that I could change the layout based on what Iḿ going to use. Example: if I seed my database with male stuff, the app will have to use the male layout. The same happens if I seed with female data.
In my searchs I have found the nested layouts
and even some theme generators gens, that I don't think will actually work since I already have the layouts made.
Any one has any new idea?
Thanks in advance.
Upvotes: 0
Views: 340
Reputation: 4043
Given you know how to detect what layout to load, something like this should work:
class ApplicationController < ActionController::Base
layout :choose_layout
protected
def choose_layout
*your male/female logic* ? "male" : "female"
end
end
Upvotes: 3