Module: Bridgetown::Routes::ViewHelpers

Included in:
Bridgetown::RubyTemplateView::Helpers
Defined in:
bridgetown-routes/lib/bridgetown-routes/view_helpers.rb

Defined Under Namespace

Classes: Flash

Instance Method Summary collapse

Instance Method Details

#_blank_flashObject



47
48
49
# File 'bridgetown-routes/lib/bridgetown-routes/view_helpers.rb', line 47

def _blank_flash
  @_blank_flash ||= Flash.new
end

#csrf_tagObject



51
52
53
# File 'bridgetown-routes/lib/bridgetown-routes/view_helpers.rb', line 51

def csrf_tag(...)
  roda_app.csrf_tag(...)
end

#csrf_tokenObject



55
56
57
# File 'bridgetown-routes/lib/bridgetown-routes/view_helpers.rb', line 55

def csrf_token(...)
  roda_app.csrf_token(...)
end

#flashObject



43
44
45
# File 'bridgetown-routes/lib/bridgetown-routes/view_helpers.rb', line 43

def flash
  roda_app&.flash || _blank_flash
end

#requestObject Also known as: r



34
35
36
# File 'bridgetown-routes/lib/bridgetown-routes/view_helpers.rb', line 34

def request
  roda_app&.request
end

#responseObject



39
40
41
# File 'bridgetown-routes/lib/bridgetown-routes/view_helpers.rb', line 39

def response
  roda_app&.response
end

#roda_appObject



30
31
32
# File 'bridgetown-routes/lib/bridgetown-routes/view_helpers.rb', line 30

def roda_app
  view.resource&.roda_app
end