Jerome .


280 Experience
1 Lesson Completed
0 Questions Solved


That template was gold. Here's a gist that that extends that thinking, looking at setting up a basic working environment:

Posted in Hotwire Modal Forms Discussion

right now it essentially returns to the same URL (once clicked upon)

Posted in Hotwire Modal Forms Discussion

always value. But what happened to the download functionality. I frequently pause & re-wind; having the copy locally is time & bandwidth-friendly...

Posted in Deploy Ubuntu 20.04 Focal Fossa Discussion

*deployment hangs RAILS_ENV=development on assets precompile Rails *

INFO [7e60e5e4] Running $HOME/.rbenv/bin/rbenv exec bundle exec rake assets:precompile as deploy@...243
 DEBUG [7e60e5e4] Command: cd /home/deploy/zappa/releases/20210110095959 && ( export RBENV_ROOT="$HOME/.rbenv" RBENV_VERSION="2.6.1" RAILS_ENV="development" RAILS_GROUPS="" ; $HOME/.rbenv/bin/rbenv exec bundle exec rake assets:precompile )
 DEBUG [7e60e5e4]   error Couldn't find an integrity file
 DEBUG [7e60e5e4]   error Found 1 errors.
 DEBUG [7e60e5e4]   

  Your Yarn packages are out of date!
  Please run `yarn install --check-files` to update.

To disable this check, please change `check_yarn_integrity`
to `false` in your webpacker config file (config/webpacker.yml).

running yarn install --check-files either locally or in the file server does not change behaviour one iota (on the server it is pointless as the next deployment creates a new directory). Setting 'check_yarn_integrity' to false does not change the behaviour.

Now I have read that should be in the shared directory (append :linked_dirs, public/packs, node_modules) which make sense given the two directories can be a 200 MB bloat. Tried that... no happiness.
The github repositry states: ensure that the installed packages match the yarn.lock file. ; the VPS yarn.lock file is empty. Another assumption I have been working on is the environment; it could be that development mode

yarn install --check-files did finally populate the shared directory ([ahem] after I had polluted all sorts of other directories. That moved the process further... to another error.

LoadError: Could not load the 'listen' gem. Addgem 'listen'to the development group of your Gemfile
buuut... that was already loaded.

Error identical to running Running RAILS_ENV=development bundle install; but this returns a clue:

Gems in the groups development and test were not installed.

SO and rails repo ( comments of moving the gem from the development block to the global block .
RAILS_ENV=development bundle install can now run (you'll see the various modules taking their time to compile (hundreds of MBs worth). Deployment can proceed.

1 - ensure append :linked_dirs, 'node_modules', 'public/packs'
2 - if in dev mode, move listento general block.
3 - Run RAILS_ENV=development bundle install on server to feel safe.

Then question if you need the other dev block gems on the server and move those to the global block.
OK. I am not aware of how to install those deve/test gems remotely. Any suggestion is welcome.

Posted in Deploy Ubuntu 20.04 Focal Fossa Discussion

Notes on this guide
1 : the section for deployment, where you mention the block to edit, it ought to be stated that it should follow the line install_plugin Capistrano::SCM::Git otherwise bad ordering will make the cap commands fail.
2: I would suggest on the capfile configuration comment to include all files that you need to avoid being committed via gitignore (assuming not using environment variables), [often initializer] files with keys to things like s3, e-commerce, devise ...

Posted in How to use Hotwire in Rails Discussion

Read somewhere: 'Rails 6 defaults to using Webpacker for Javascript instead of the asset pipeline'
Turbolinks is dead. Rails 6.1, few hours later hotwire and one can manage javascript via the asset pipeline. Turbo [something]. A Phoenix was sighted.


So what happens when one migrates an app from 5 to 6, then realizes this is hot and loads the gem.
What conflicts could arise?

Errant tangential thought:
God forbid Jack has a remote control over Chris's fan when he invokes editing a tweet.

Has anybody experienced yarn not finding flatpicker?

yarn add flatpicker
yarn add v1.22.4
[1/4] 🔍 Resolving packages...
error An unexpected error occurred: " Not found".

Interesting curve on the road to sending a Twilio SMS. Running the command as per the send_text method suggested, ran the first time from localhost.

But somehow, after adjusting the method to be able to handle the API response, Rails 5 complains with:
ArgumentError (Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true) I am certain the method is firing (because when the conditions are not met, the console prompt returns to a ready state & testing without the added line generates the SMS).

Thus, adding status_callback: update_twilio_reminder_url(reminder.user_id),to the method is hanging because it needs a defaulturl option. But which? certainly not action_mailer's? config.application.default_url_options? config.application.routes.default_url_options? On this point, the rails guide is as opaque as the error message...

Posted in Error Tracking with Errbit Discussion

I am trying to wrap around my head around the hooks. The first immediate hook is errbit knowing the application's github repository. The second is the airbreak.rb file where the app (and I assume all of its deploys) actually points to errbit application and its services. So I understand airbreak config... 'send my errors to errbit'. But why then does errbit need to know about to the repo?

A corollary question: if there are multiple deploys, say 'staging1' and 'staging2' are added, they will all be handled by errbit and show the non-traditional deploy name (unless stated in ignore_environments config line) ?

Another suggestion is a non-rails issue, but fundamental nonetheless: focus on the database queries themselves. A great suggestion I have held dear over the years is to ask "what are the critical queries an application may have?" (the most frequent one, the most valuable, the most calculation intense...) On that basis, with a knowledge of how databases index, one can often find a data structure that is more efficient than another (conception over optimisation). Large test data sets for different data structures allow to validate design choices. To me, that is the core of the onion...

Posted in In-App Navbar Notifications Discussion

Very useful and good pacing/progression of arguments.

Two questions.
1) the onClick handler is going to go to an object, so the page is going to be refreshed anyways. To make a counter decrement by 1, several options are available: one is to check the object and find Notification with equivalent object_id and type and recipient = current_user and update that. The other is to have routing as member and have the coffee script call `url: "notifications/#{id}/mark_as_read` and update there. I am not sure of which avenue is better (I believe the second may be faster), nor the proper syntax to generate the notification id in the url

2) you mentioned polling. Websockets would be the best solution for one with a server. This has two caveats. As a user, I have seen notifications be browser tab-dependant (I use a lot and do not always get notifications); it is a worry. In an exploratory phase (i.e. no significant traffic numbers), one could reason: 'let the user decide'. what would be a quick and dirty way to have a fa refresh icon update the notification status?

er... and testing rotating a second time needs production traffic to run if `notifempty` is set !

Add `this takes barely 5 minutes to read and complete` ;-). Concise badge. Also, your article should have a date on them (both created and updated); provides added insights as to potential gotchas from framework changes over time.

Posted in Deploy Ubuntu 14.04 Trusty Tahr Discussion

That may explain why I hit a small bump with the above. Editing the Capfile would then *not* need `require 'capistrano/bundler'`. Next time I deploy, I'll report back...

Posted in Deploy Ubuntu 14.04 Trusty Tahr Discussion

You mention that Capfile should include `require 'capistrano/rails'`. However the base cap installation has commented out ` # require 'capistrano/rails/assets' # require 'capistrano/rails/migrations' ` What is the delta between these two options?

Posted in Introduction to Importing from CSV Discussion

my thinking is that the end-user, not the developer is going to hit these errors and need to act upon them. So it is a top-level priority. A couple of instance variables under model's `def self.import(file) rescue @counter += 1 @check_me << row end` should gather the data, but controller `def import if @counter > 0 redirect_to chosen_modes_path, notice: @check_me ` hits a

nil:NilClass error. I guess, passing from ruby library to rails is what eludes me.

Posted in Introduction to Importing from CSV Discussion

A big difficulty is gathering the errors and viewing them in the resulting rails view...

Works also with button_to, but to invoke font awesome [... remove needles spaces in what follows ...] data: {disable_with: raw(" < i class='fa fa-spinner fa-spin'> < /i>One moment please...")}

logo Created with Sketch.

Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

© 2021 GoRails, LLC. All rights reserved.