Skip to content

Latest commit

 

History

History
94 lines (62 loc) · 4.06 KB

DEVNOTE.md

File metadata and controls

94 lines (62 loc) · 4.06 KB

DEVELOPER NOTE

Note for developer. Haha just kidding. This is a note that records some of the setup process or technical issues faced during the development of this project.

Environment Setup


A note of how I setup my environment for Ruby and Rails inside WSL.

Setup nvm on wsl

Setup rvm on wsl

Extra learning


Ruby data structure

  • arrays & ranges
  • hashes & symbols
  • block
  • Instance variable vs local variable vs class variable

Testing

Partials

  • Example, the _file.html.erb with underscore at front is the convention of defining partials. Partials is like a snippet of code that could be inserted into other html.erb codes.

has_secure_password

  • password digest, aka, hashed password.

Fixture

Attribute accessor

  • Basically a shortcut for instance variable functionality. Learn more about attr_accessor

What is Action Dispatch

Basically, rails consists of 3 Action Packs

  • Action Dispatch routes request to controllers
  • Action Controller converts requests into responses
  • Action View is used by Action Controller to format those reponse

Learn more in this blog

Ruby keywords

  • Raise an exception
  • debugger to debug

What does << mean in Ruby?

HTML

  • <strong> tag shows the text with strong importance and it's usually bold

Other topics


Some other troubles I got into, haih...

Reset password on WSL

  • Long story short.. change to root user and chpsswd for liew user, then relogin back.

View a file in WSL

  • wslview filename.pdf

Unable to donwgrade yarn

Don't run bundler as root

Package directory not part of the project

  • Received a warning messsage: "The nearest package directory doesn't seem to be part of the project". Turns out it is because there's a yarn.lock (or package.json) file higher up in the filetree, see this github issue

Unable to host in heroku

Heroku bundle version

Heroku yarn version

rails console stop working when used Ctrl + c

SQLite3 Locked

  • Error: ActiveRecord :: StatementInvalid: SQLite3 :: BusyException: database is locked, tried all methods listed here. However, the one that only works is ... restarting my computer...