Skip to content

Instantly share code, notes, and snippets.

@laurenhavertz
Last active December 20, 2015 02:19
Show Gist options
  • Select an option

  • Save laurenhavertz/6055466 to your computer and use it in GitHub Desktop.

Select an option

Save laurenhavertz/6055466 to your computer and use it in GitHub Desktop.
RAILS RESOURCES

VIEW

  • attaches to controller through yield
  • attaches to helper form action:/search
  • avoid calling controller methods in the view
    • should never tell controller to do something in order for view to render something else

CONTROLLER

  • instance variable
  • connects to view through actions
  • creates instances of the model/finds models
  • API calls

HELPER

  • forms used across the app
  • captures info use to controller
  • random methods

RAILS

  • form
  • link
  • convert

ROUTES

  • attaches to controller and calls to outside (APIS) through method

MODEL

  • contains data
  • only place that knows where data exists
  • provides object oriented view of relationship of data to data base
  • methods in model store data and are based on the data inside
  • mess with model all day long as long as you don't break the interface
  • random methods that rely on model data

PUBLIC

  • used names that let others know what you are doing
  • only necessary parts

PRIVATE

  • things that you don't want outside world to see
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment