Working with Views in Rails

Not CompletedSection Introduction

In this section you'll learn how to work with Views in Rails, including: using custom layout files, working with partials, using Rails view helpers, and how to dynamically generate HTML code.

Not CompletedHow to Customize the Rails Master Layout File

Rails provides a master layout file that allows programs to have a single file that can share components such as: a navigation bar, login links, and other items that are required on multiple pages. In this guide we'll walk through the Rails master layout file and examine how we can customize it and therefore add elements that are shared across the application.

Not CompletedGuide to Using Multiple Layout Files in Rails 5

As helpful as the master application layout file is in Rails, we also have the ability to implement custom layout files in an application. This guide walks through how to build two custom layout files, one for our blog, and another for the portfolio pages.

Not CompletedIntroduction to Partials in Rails 5

Partials in Rails are a great way to share view components across multiple pages. Additionally, partials help make it possible to limit duplicate view code in an application. In this guide we'll walk through an introduction to Rails partials and refactor our navigation bar so that it can be shared across multiple layouts.

Not CompletedHow to Send Data to Partials to Generate Custom Behavior in Rails 5

In addition to partials allowing applications to share view code, Rails also makes it possible to send data to partials in order to give them custom behavior. In this guide we'll examine how we can use locals in partials to refactor the Portfolio form and to add dynamic styles to the navigation bar.

Not CompletedGuide to View Helpers in Rails 5

View helpers are a great way to store view logic in a Rails application. In this guide we'll walk through: what view helpers are, how they can be used, how they are different from partials, and how to implement them in order to store the logic for our application's auth links.

Not CompletedHow to Use the Rails Content Tag Helper to Auto Generate HTML Code

So far we've covered the ability to hard code HTML code into a Rails view helper method. In this guide we'll walk through how to leverage the content_tag helper method to auto generate HTML code in a Rails 5 application.

Not CompletedIntroduction to Rendering Collections via Partials in Rails 5

This introductory guide walks through how to leverage partials to automatically render collections of data. We'll also walk through when this approach works and when you will need to manually configure the process.

Not CompletedGuide to Manually Configuring Partials to Work with Collections in Rails

In the last guide we implemented an automated way to render collections in a Rails view template. In this guide we'll examine how we can manually configure collections to work with partials.

Not CompletedGuide to Helpful ActionView Helper Methods in Rails 5

This guide walks through how to implement powerful ActionView helper methods in a Rails application to perform tasks such as rendering how long ago a blog post was created, how auto render currency, and much more.

Not CompletedDeep Dive: Tips and Tricks to Working with ActionView in Rails 5

This deep dive examines various processes associated with ActionView. Specifically, we'll walk through: what ActionView is, how to manage views in a Rails application, how to work with partials, and much more.


Views in Rails
    Unsupported Browser

    devCamp does not support ancient browsers.
    Install a modern version for best experience.