Class: Qor::Layout::Layout

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/qor/layout/layout.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.detect_layout(name, app = nil) ⇒ Object



8
9
10
11
12
# File 'app/models/qor/layout/layout.rb', line 8

def self.detect_layout(name, app=nil)
  scope  = where(:name => name)
  action = Qor::Layout::Action.detect_action(app)
  scope.where(:action_name => action.try(:name)).first || scope.first
end

Instance Method Details

#render(edit_mode = false) ⇒ Object



14
15
16
# File 'app/models/qor/layout/layout.rb', line 14

def render(edit_mode=false)
  settings.map {|setting| setting.render(edit_mode) }.join("")
end