/rails_partials_helpers

Refactoring exercise to review Rails partials and helpers.

Primary LanguageRuby

Review: 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:create db:migrate (make sure PosgreSQL is running).
  4. Start your Rails server, then you're ready to go!

Steps to Refactor

  1. Find all forms in this application, and refactor them to use the form_for helper. (docs)
  2. Refactor any duplicate code (hint: recipes new and edit forms) to use a partial. (docs)
  3. While you're at it, refactor the Bootstrap nav in the application layout to use a partial as well.
  4. Find all <a></a> tags in the views, and refactor them to use the link_to helper. (docs)
  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.