Rails Best Practices and Refactors


Not CompletedSection Introduction

This section focuses on Rails best practices and how they can be incorporated into an application, including how to protect against bugs, improving data integrity, and testing for security issues.

Not CompletedPlanning Final Project Updates and Assignment

In this guide we'll examine the final items that need to be completed prior to deploying the application.

Not CompletedBuilding a Scope to Show the Most Recent Blog Posts and Hiding Drafts from Non Admins

It's important to understand how to securely show and hide posts from users. In this guide we'll walk through how to use custom scopes to hide draft posts blog posts from non admin users. We'll also examine how we can leverage the status enum to easily call draft and published blog posts.

Not CompletedHiding the Show Page for Blogs in Draft Mode in Rails 5

Even though our blog's CRUD actions are protected from hackers, we still need to hide the show page from users and search engines when a post is in draft mode. In this guide we'll walk through how to add that logic into the controller.

Not CompletedHow to Add a Drop Down Form Element in Rails 5 for Parent/Child Relationships

This guide walks through how to implement a collection_select form element that allows for a drop down select box to be shown to users. Additionally we'll integrate bootstrap styles for the drop-down box.

Not CompletedUsing the Controller Generator to Build the Topic Features

Presently, our application has a model for topics, however there is no view component that can be accessed by users. In this guide we'll build out the Topic feature and leverage the controller generator so that topics can be shown on the app.

Not CompletedHow to Build a Widget for the Blog to Render Topics in Rails 5

This guide examines multiple ways to implement a widget that renders a list of topics on each page of the blog layout.

Not CompletedHow to Implement Radio Buttons in a Rails Form to Update Enum Values for the Blog Status

Working with radio buttons is an important skill to have when it comes to building out forms in Rails. In this guide we'll examine how to update the Blog status enum value with a radio button.

Not CompletedGuide to Integrating Markdown and Syntax Highlighting in a Rails 5 Application

Currently our blog posts cannot be styled. In this guide we're going to walk through how to integrate the ability to parse markdown formatted text so that blog posts render styled content. Additionally, we'll examine how to build out the ability to implement syntax highlighting for code snippets.

Not CompletedIntegrating Breadcrumbs and Icons for the Blog Show Pages

This guide walks through how to leverage the Bootstrap 4 breadcrumb class to add breadcrumb styles to the blog show page.

Not CompletedBuilding a Partial for Managing Admin Actions for Blog Posts

Our application currently has a list of actions associated with each blog post. In this guide we're going to walk through how to refactor the action links into a partial that can be called from anywhere in the application.

Not CompletedHow to Implement a Responsive Navigation Bar with Bootstrap 4

This guide examines how to swap out the navigation bar for the blog so that it's responsive on all device sizes.

Not CompletedUpdating the Source/Session Tracking System for the New Layouts

Do you remember our source tracking system? With our new designs in place it's time to start implementing it into the full application. In this guide we'll update the view helper method and give it the ability to take in special classes.

Not CompletedHow to Integrate a Favicon in Rails 5

This guide examines how to generate and then implement a favicon image in a Rails 5 application.

Not CompletedImplementing Responsive Image Components for the Portfolio Layout

In analyzing the application, it looks like there are a few bugs with our portfolio layout. Specifically, images can be distorted at certain aspect ratios and the grid layout is not responsive. In this guide we'll examine how to leverage the Bootstrap grid layout so that the portfolio adjusts to various device sizes.

Not CompletedAdding Card Styles to the About and Contact Pages

In this final sub section of the course we'll walk through final style changes for the application layout file. In this guide we'll update the about and contact pages so they utilize the Bootstrap 4 Card class.

Not CompletedHow to Implement Collapsable Content Components in a Rails 5 Application

Our About page is looking better, but there is still more content that needs to be added to the page. Instead of simply adding more text to the page we're going to integrate collapsable components, so that users to your site can click to view additional information about you. Additionally, the Bootstrap 4 collapsable class ships with smooth sliding animations by default, so the process is relatively straightforward compared with building a jQuery component from scratch.

Not CompletedHow to Integrate Bootstrap Progress Bars in a Rails Application

This guide examines how to implement Bootstrap 4 progress bars in a Rails application. Specifically, we're going to walk through how to render our skills as progress bars to give their values a visual component.

Not CompletedHow to Integrate Custom Fonts in a Rails 5 Application

This guide walks through two ways that you can integrate custom fonts. One way is to call fonts from a CDN. The second is to leverage the Rails Asset Pipeline and install a fonts directory.

Not CompletedUpdating the Seeds File in Rails

As a matter of practice, it's important to continually update your seeds file as your data models change. This makes it possible to always have quick access to a comprehensive set of test data. In this guide we're going to make it possible to create sample users from the seeds file.

Quizzes


Rails Best Practices and Refactors
    Unsupported Browser

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