class AutoForme::Request

  1. lib/autoforme/request.rb
Superclass: Object

Request wraps a specific web request for a given framework.


action_type [R]

A string representing the action type for the request

controller [R]

The underlying web framework request instance for the request

env [R]

The HTTP request environment hash

id [R]

The id related to the request, which is usually the primary key of the related model instance.

method [R]

The request method (GET or POST) for the request

model [R]

A string representing the model for the request

params [R]

The params for the current request

path [R]

A string representing the path that the root of the application is mounted at

session [R]

The session variables for the current request

Public Instance methods


Whether the current request used the POST HTTP method.

[show source]
   # File lib/autoforme/request.rb
36 def post?
37   method == 'POST'
38 end

The query string for the current request

[show source]
   # File lib/autoforme/request.rb
41 def query_string
42   @env['QUERY_STRING']
43 end

Set the flash at notice level when redirecting, so it shows up on the redirected page.

[show source]
   # File lib/autoforme/request.rb
47 def set_flash_notice(message)
48   @controller.flash[:notice] = message
49 end

Set the current flash at error level, used when displaying pages when there is an error.

[show source]
   # File lib/autoforme/request.rb
53 def set_flash_now_error(message)
54[:error] = message
55 end