Class: Lurker::RenderingController

Inherits:
AbstractController::Base
  • Object
show all
Includes:
AbstractController::Helpers, AbstractController::Layouts, AbstractController::Rendering, ActionView::Context, ActionView::Layouts, ActionView::Rendering
Defined in:
lib/lurker/rendering_controller.rb

Direct Known Subclasses

FormBuilder

Instance Method Summary collapse

Instance Method Details

#cookiesObject

so that your cookies calls still work



56
57
58
# File 'lib/lurker/rendering_controller.rb', line 56

def cookies
  {}
end

#flashObject

so that your flash calls still work



41
42
43
# File 'lib/lurker/rendering_controller.rb', line 41

def flash
  {}
end

#paramsObject

and params will be accessible



51
52
53
# File 'lib/lurker/rendering_controller.rb', line 51

def params
  {}
end

#protect_against_forgery?Boolean

we are not in a browser, no need for this

Returns:

  • (Boolean)


25
26
27
# File 'lib/lurker/rendering_controller.rb', line 25

def protect_against_forgery?
  false
end

#requestObject

and nil request to differentiate between live and offline



46
47
48
# File 'lib/lurker/rendering_controller.rb', line 46

def request
  OpenStruct.new
end

#tag_with_anchor(tag, content, anchor_slug = nil) ⇒ Object



29
30
31
32
33
34
35
36
37
38
# File 'lib/lurker/rendering_controller.rb', line 29

def tag_with_anchor(tag, content, anchor_slug = nil)
  anchor_slug ||= content.downcase.gsub(' ', '_')
  <<-EOS
  <#{tag} id="#{anchor_slug}">
    <a href="##{anchor_slug}" class="anchor">
      #{content}
    </a>
  </#{tag}>
  EOS
end