Skip to content

Instantly share code, notes, and snippets.

@danielnmai
Last active May 27, 2017 00:02
Show Gist options
  • Save danielnmai/6db0e47cf2206cb68a24642a9060f7da to your computer and use it in GitHub Desktop.
Save danielnmai/6db0e47cf2206cb68a24642a9060f7da to your computer and use it in GitHub Desktop.

----05/21/2017----- Met Luke today: learn to talk to people naturally => it may lead to a job opportunity. Learned how to use Screencast and iMovie to create a video blog cast.

----05/23/2017----- IMPORTANT! Remember to capitalize model name rails g model CartedProduct product_id: integer order_id: integer Remember controller names are plural rails g controller CartedProducts

----05/24/2017----- MVP?? Minimum Viable Product Whiteframe bundle and bundle install : THE SAME! Front End validation vs. Back end validation validates :name :presence => true #The name cannot be blank. validates :email, uniqueness: true #Email must be unique. validates :points, :numericality => true #the points attribute must be number (integer, float, decimal) validates :points, :numericality => {only_integer: true}

Whenever you have a Rollback when trying to update database, view the error with: [variable].errors.full_messages`

----05/25/2017----- root "users#index" resources users, except [:new]

rails g controller ModelNames index create new edit destroy

nested route: the "as:[]" is to specify the prefix for the route.

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