eps / rails_partials_helpers

Refactoring exercise to review Rails partials and helpers.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Rails Partials & Helpers

Objective: Refactor all 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 into your develop folder on your local machine.
  2. Change directories into rails_partials_helpers, and bundle install.
  3. Run rake db:setup (make sure PosgreSQL is running).
  4. Start your Rails server; then you're ready to go!

Steps to Refactor

  1. Find all <a></a> tags in the views, and refactor them to use the link_to helper. (docs)
  2. Find all forms in this application, and refactor them to use the form_for helper. (docs)
  3. Refactor any duplicate code (hint: recipes new and edit forms) to use a partial. (docs)
  4. While you're at it, refactor the Bootstrap nav in the application layout to use a partial as well.
  5. Find all redirects (redirect_to) in the controller methods, and refactor them to use path prefixes. (docs)

Refer to the solution branch for guidance.

About

Refactoring exercise to review Rails partials and helpers.


Languages

Language:Ruby 65.2%Language:HTML 31.5%Language:CSS 1.8%Language:JavaScript 1.5%