Module: Skyline::JsLayoutHelper

Defined in:
app/helpers/skyline/js_layout_helper.rb

Instance Method Summary collapse

Instance Method Details

#has_js_layout?Boolean

Returns:

  • (Boolean)


6
7
8
# File 'app/helpers/skyline/js_layout_helper.rb', line 6

def has_js_layout?
  @_js_layout.present?
end

#render_js_layoutObject



10
11
12
13
14
15
16
17
18
# File 'app/helpers/skyline/js_layout_helper.rb', line 10

def render_js_layout
  return unless @_js_layout
  
  t = ["Layout"]
  t << {:content => "Content", :media => "Media"}[@_js_layout.to_sym]
  
  layout_js = "new Application.#{t.compact.join(".")}()"
  javascript_tag(layout_js)
end

#use_js_layout(name) ⇒ Object



2
3
4
# File 'app/helpers/skyline/js_layout_helper.rb', line 2

def use_js_layout(name)
  @_js_layout = name
end