Skip to content

Instantly share code, notes, and snippets.

@kamiboers
Created April 22, 2016 15:47
Show Gist options
  • Save kamiboers/c11c4e29a835b31fa3c6659093217ead to your computer and use it in GitHub Desktop.
Save kamiboers/c11c4e29a835b31fa3c6659093217ead to your computer and use it in GitHub Desktop.

Week 5 Diagnostic

When and why would you rebase? In preparation to merge your branch into master, in order to squash small commits and make the git log easier to interpret.

What are the steps to do a basic rebase via the command line? git rebase -i HEAD~<# of steps backward in the commit log>

Our cart in Little Shop is not stored in the database. How does its state persist across requests? As of right now, it's stored in a session that is only cleared when the user leaves/logs out.

Name two objects used in Rails that can be used to track state of the user across requests. Session and cookies.

Draw the MVC model and the request response cycle through a rails app. ex: https://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller#/media/File:MVC-Process.svg

Give an example of something you'd use a Rails helper for. To remove logical processes from a rails controller. ex: determining whether a user is present/logged in

How can we clean up duplicated code in the views? with partials!

What type of variable is automatically available in a partial? instance

If you want to use a local variable in a partial, what syntax is used? <%= render partial: "partial_name", locals: { variable: variable }

Describe the function and duties of the asset pipeline. the asset pipeline organizes resources used for a single app, across multiple apps or provided by the client.

Give an example of an unacceptable use of a callback in Rails. to utilize methods or alter resources outside of the controller that you're in

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment