I have a two versions of my application layout, which are differs only in a few lines. Consider following example:
!!!
%html
%head
# a lot of cod
Okay, so I found the solution by myself:
class ApplicationController < ActionController::Base
layout 'layout'
before_filter :set_constants
def set_constants
@flag = true
end
end
And the template should be:
!!!
%html
%head
# a lot of code here
%body
# some more code here
- if @flag
# variant 1
- else
# variant 2