Sha256: dbfaade0c094c89c229eaceda9715f22aab30432e193ae9e5720b5b9c2e11c9e

Contents?: true

Size: 1.15 KB

Versions: 4

Compression:

Stored size: 1.15 KB

Contents

# Overview

There are many ways to render content to the screen in web applications. Ruby on Rails offers a couple of default strategies right off the bat through its combination of ActionController, ActionView, and ERB templating language:

* Rendering content within an ActionView template (the controller action) and layout
* Pulling in additional content through rendering partials
* Capturing content from a block and outputting that content at some later point
* Calling a different method from the controller action which determines what and how to render

There are obviously additional means to render output, such as the redirect methods in a controller and rendering inline code, but generally speaking, most generated output come about through one of those above methods.

The approaches listed above can essentially be generalized as follows

* Rendering using a method
* Rendering fragments (using a Rails' partial)
* Storing content for later rendering (using a Ruby Block)
* Proxying to another source that knows what to / how to render

The Blocks gem attempts to take these four concepts and provide one common interface.

The reasoning behind this is simple.

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
blocks-4.0.1 docs/_includes/overview.md
blocks-4.0.0 docs/_includes/overview.md
blocks-4.0.0.rc2 docs/_includes/overview.md
blocks-4.0.0.rc1 docs/_includes/overview.md