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.
- Fork this repo, and clone it to your local machine.
- Change directories into
rails_views_helpers_training
, andbundle install
. - Run
rake db:create db:migrate db:seed
(orrake db:setup
). - Start your Rails server; then you're ready to go!
- Find five
<a></a>
tags in the views, and refactor them to use thelink_to
helper.
Tip: Use Command + Shift + F to bring up an interface to search all project files in Atom or Sublime.
-
Find one form in this application, and refactor it to use the
form_for
helper. -
Refactor one instance of duplicate code (hint: recipes new and edit forms) to use a partial.
-
While you're at it, refactor the Bootstrap navbar in the application layout to use a partial or named yield.
-
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.