Module: Flatrack::View::RequestHelper
- Included in:
- Flatrack::View
- Defined in:
- lib/flatrack/view/request_helper.rb
Overview
View helpers to access the params and path
Instance Method Summary collapse
-
#cookies ⇒ Hash
Returns the cookies.
-
#current_page ⇒ String
(also: #page)
Returns the page being displayed.
-
#current_path ⇒ String
(also: #path)
Returns the path before rewrites.
-
#params ⇒ Hash
Returns the query parameters.
-
#request_ip ⇒ String
Returns the IP address for the request.
Instance Method Details
#cookies ⇒ Hash
Returns the cookies
33 34 35 |
# File 'lib/flatrack/view/request_helper.rb', line 33 def @response.request.env['rack.cookies'] end |
#current_page ⇒ String Also known as: page
Returns the page being displayed
20 21 22 |
# File 'lib/flatrack/view/request_helper.rb', line 20 def current_page @response.request.page end |
#current_path ⇒ String Also known as: path
Returns the path before rewrites
13 14 15 |
# File 'lib/flatrack/view/request_helper.rb', line 13 def current_path @response.request.path end |
#params ⇒ Hash
Returns the query parameters
7 8 9 |
# File 'lib/flatrack/view/request_helper.rb', line 7 def params @response.request.params end |
#request_ip ⇒ String
Returns the IP address for the request
27 28 29 |
# File 'lib/flatrack/view/request_helper.rb', line 27 def request_ip @response.request.env['REMOTE_ADDR'] end |