Skip to content

Instantly share code, notes, and snippets.

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

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

Select an option

Save laurenhavertz/5950540 to your computer and use it in GitHub Desktop.
RUBY RESOURCES

Don't use as a function name

  • alias
  • break
  • def
  • else
  • ensure
  • if
  • next
  • retry
  • or
  • super
  • undef
  • when
  • and
  • case
  • defined
  • elsif
  • false
  • in
  • nil
  • redo
  • return
  • then
  • unless
  • while
  • begin
  • class
  • do
  • end
  • for
  • module
  • not
  • rescue
  • self
  • true
  • until
  • yield

Rails MVC (Model View Controller / Request Response Cycle)

  • controller

    • responds to the request and encapsulates logic and handles the request
    • layout program to respond to the request
    • creates representation (model)
    • assembles pieces to field the request
    • manages interactions
    • tells rails where to go on the server
  • MODEL

    • knows how to communicate to the data base
    • grabs and returns info to the controller
  • VIEW

    • renders the page passes back to the controller
    • response kicks it back to the browser

Rails

  • application controller- MASTER CONTROLLER
  • application helper - can handle methods

Syntax of Naming

  • class: ClassName
  • model: User (singular)
  • controller: somethingsName (plural)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment