Skip to content

SF-WDI-LABS/rails-views-partials-helpers-lab

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rails Views & Helpers Training

Objective: Refactor forms, links, and redirects in this application to take advantage of Rails partials, view helpers (form_for and link_to), and path prefixes.

Getting Started

  1. Fork this repo, and clone it to your local machine.

  2. Change directories into the project directory, and bundle install.

  3. Run rails db:create db:migrate db:seed (or rails db:setup).

  4. Start your Rails server, and you're ready to go!

Steps to Refactor

  1. Find two <a></a> tags in the views, and refactor them to use the link_to helper.

Tip: Use Command + Shift + F to bring up an interface to search all project files in Atom or Sublime.

  1. Find one form in this application, and refactor it to use the form_for helper.

  2. Refactor the recipes new and edit forms to use a partial.

  3. While you're at it, refactor the Bootstrap navbar in the application layout to use a partial.

  4. Find one redirect (redirect_to) in the controller methods, and refactor it to use path prefixes.

Refer to the solution branch if needed for guidance.

About

Refactoring exercise to review Rails partials and helpers.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 67.2%
  • HTML 26.3%
  • CSS 2.7%
  • JavaScript 2.5%
  • CoffeeScript 1.3%