Notes / rails
- Deferred tab counts with Turbo Frames The problem I’m currently working on adding different types of records to the Cults search page. Instead of being able to query creations only, users can now search for creations, bundles and public collections (with more types of records to come). Right now, the search page has three tabs: creations, bundles and public collections. Each tab has a small counter component which displays how many results it has, so users can see if their query matched before navigating to one of these tabs. To show these counters to the users, the page needs to query a bunch of stuff before
- Today I learned a nifty Turbo Frames trick: how to persist scroll depth accross a page refresh. I’m currently working on bundles for cults3D. On the general index of bundles, I have a section displaying 6 bundles manually selected by the Cults’ team. Then, I have my list of bundles sorted by newest to latest. I’m working on adding a component with some filters in it: toggles, sorting, you know, the work. And this poses a problem: when I toggle a filter, the whole page reloads and I’m back at the top of the page. So to see my filtered
- Notes on Rebuilding Rails Currently reading Rebuilding Rails by Noah Gibbs. Notes: Chapter 3 Sometimes, Noah writes methods in the context of a module, sometimes in the context of a class. Why? Modules are collections of methods and constants. They cannot generate instances. Classes may generate instances (objects), and have per-instance state (instance variables). Source Checking rails/active_support_dependencies/autoload.rb and I see this @_at_path. What is the reason for this @_? So, @_instance_var has no special meaning. Rails internally uses it to distinguish private/protected variables that other should not modify/access. source bundler: failed to load command: rackup Couldn't find handler for: puma, thin, falcon, webrick. (LoadError)