Run rake middleware
to see all rack filters.
Option for adding a new filter:
• config.middleware.insert_after(existing_middleware, new_middleware, args)—Adds the new middleware after the specified existing middleware in the middleware stack.
• config.middleware.insert_before(existing_middleware, new_middleware, args)—Adds the new middleware before the specified existing middleware in the middleware stack.
• config.middleware.delete(middleware)—Removes a specified middleware from the stack.
• config.middleware.swap(existing_middleware, new_middleware, args)—Swaps a specified middleware from the stack with a new class.
• config.middleware.use(new_middleware, args)—Takes a class reference as its parameter and just adds the desired middleware to the end of the middleware stack.
Make a request manually from Rails console:
>> env = {}
>> env['REMOTE_ADDR'] = '127.0.0.1'
>> env['REQUEST_METHOD'] = 'GET'
>> env['PATH_INFO'] = '/products/1'
>> env['rack.input'] = StringIO.new
>> rack_body_proxy = R5kitchensink::Application.call(env).last
>> rack_body_proxy.last
Format response as YAML:
>> y R5kitchensink::Application.call(env)
Include custom helper for using in console mode
Redirecting console output to STDOUT
Simple resource creation for CRUD operations
Adding nested resources example
Example of route resource concerns
Add route customization example
Map to a different controller example
Routes for new resources example
Respond to a specific format and show link with an extension
Example of redirecting from controller More redirecting options
Example of rendering another template
Example of rendering inline template code
Example of rendering plain and using a helper
Example of rendering Javascript
Example of changing the layout
Example of setting callbacks on controller
Example of using prepend_before_action
Example of ActiveRecord table configurations
Example of adding a default value for a field directly on the model