module Flatrack::View::RequestHelper

View helpers to access the params and path

Public Instance Methods

cookies() click to toggle source

Returns the cookies @return [Hash]

# File lib/flatrack/view/request_helper.rb, line 33
def cookies
  @response.request.env['rack.cookies']
end
current_page() click to toggle source

Returns the page being displayed @return [String]

# File lib/flatrack/view/request_helper.rb, line 20
def current_page
  @response.request.page
end
Also aliased as: page
current_path() click to toggle source

Returns the path before rewrites @return [String]

# File lib/flatrack/view/request_helper.rb, line 13
def current_path
  @response.request.path
end
Also aliased as: path
page()
Alias for: current_page
params() click to toggle source

Returns the query parameters @return [Hash]

# File lib/flatrack/view/request_helper.rb, line 7
def params
  @response.request.params
end
path()
Alias for: current_path
request_ip() click to toggle source

Returns the IP address for the request @return [String]

# File lib/flatrack/view/request_helper.rb, line 27
def request_ip
  @response.request.env['REMOTE_ADDR']
end