Module: Bridgetown::Routes::ViewHelpers

Defined in:
lib/bridgetown-routes/view_helpers.rb

Defined Under Namespace

Classes: Flash

Instance Method Summary collapse

Instance Method Details

#_blank_flashObject



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

def _blank_flash
  @_blank_flash ||= Flash.new
end

#csrf_tagObject



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

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

#csrf_tokenObject



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

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

#flashObject



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

def flash
  roda_app&.flash || _blank_flash
end

#requestObject Also known as: r



22
23
24
# File 'lib/bridgetown-routes/view_helpers.rb', line 22

def request
  roda_app&.request
end

#responseObject



27
28
29
# File 'lib/bridgetown-routes/view_helpers.rb', line 27

def response
  roda_app&.response
end

#roda_appObject



18
19
20
# File 'lib/bridgetown-routes/view_helpers.rb', line 18

def roda_app
  view.resource&.roda_app
end