Rendering HTML in Rails for Dummies!

anand posted this on 02 Feb 2012

Views can be rendered in 4 simple ways from an action method.

1. Render the action's own template, named after the action's name itself. This is the default.

2. Render some other action's template from an action method, inside the same controller.

3. Render an action's template which is present in some other controller, other than the one we are calling from. 

4. Render any damn template file.

To learn more details on rendering views, see Rails guides.