SGScott Gorskyinsjgorsky.hashnode.dev·Dec 24, 2021 · 1 min readPartials and DRYFast fact for today: In the context of the app I'm building, views with the same code to render html forms can be consolidated into a partial. For example, a file called _form.html.erb with a name, email, password, etc. that appears on both signup an...00
SGScott Gorskyinsjgorsky.hashnode.dev·Dec 21, 2021 · 1 min readHAML and YAML and all thatToday's fast fact: HAML is a replacement for HTML YAML is a data language, ie a replacement for JSON and XML.00
SGScott Gorskyinsjgorsky.hashnode.dev·Dec 20, 2021 · 1 min readThe or-equals operatorThis one feels like a simple concept to teach, but an easy one to forget. The or-equals operator ||= allows a value to be assigned to a variable if and only if that variable evaluates to nil or false. Consider, for example: This can be expressed as...00
SGScott Gorskyinsjgorsky.hashnode.dev·Dec 11, 2021 · 1 min readRails "resources" and RESTful routesUsing resources :controller_name automatically adds a full suite of RESTful routes. For more limited scope controllers (like a login controller), you can use rails generate controller ControllerName new and it adds views as well.00
SGScott Gorskyinsjgorsky.hashnode.dev·Sep 11, 2021 · 1 min readIsograms and regexNever knew that word until Codewars. Thanks!00