github.com

Template inliner avoids the problem when to render a large list of objects,

github.com

An ActionMailer delivery method to save mails as files in a directory.

github.com

So you downloaded inaction_mailer, and you had a folder full of e-mails generated while writing your app?

github.com

Easily show multiple, overlapping events across calendar days and rows.

github.com

A simple implementation of an Identity Mapper for Active Record.

gem-session.com

Unfortunately vanilla Ruby modules lack support for many idioms popular in modern Ruby. Most importantly, we have become accustomed to...

github.com

Steak is like Cucumber but in plain Ruby.

github.com

Rack middleware for rate-limiting incoming HTTP requests.

github.com

File upload solution that supports form roundtrips when a validation fails.

axonflux.com

Here is a set of additive color model conversion algorithms that I found published on Wikipedia and have implemented in...

robots.thoughtbot.com

We recently decided our CI server needed an overhaul. I really enjoyed Integrity as a build server, but after trying...

gusiev.com

What do we expect from the custom finder? We expect that it should find assets A, B, C and should...

apidock.com

All ActiveRecord associations except for has_many :through support callbacks for pre- and post-insertion/deletion via the following, self...

...a lib/ext/super_client.rb to your project (see How to organize monkey patches in Ruby on Rails projects) Add the extension, which overrides both methods (prepend is available since Ruby >=2) # lib/ext/super_client.rb...

...lesson in builder mode. Jasmine is a purely client-side tool. It cannot ask Rails to render a view or access the database. Any HTTP calls must be mocked.

Tip Create the required DOM directly from your Jasmine spec. You cannot ask Rails to render a view. You can use Element#dispatchEvent() to emit events on a DOM...

...can define the vcr: true hook yourself: # spec/support/vcr.rb VCR.configure do |c| c.cassette_library_dir = Rails.root.join("spec", "vcr") c.hook_into :webmock end RSpec.configure do |c| c.around(:each, :vcr) do |example|

makandra dev

While most Rails Apps are tied to at least one external REST API, machine-to-machine communication via GraphQL is less commonly seen. In this card, I'd like to...

...w[errors]) unless response.status.ok? parsed_response end def client headers = { 'Content-Type' => 'application/json', 'Authorization' => Rails.application.secrets.fetch(:linear_api_key), } HTTP.headers(headers) end end Writing data (Mutation) Performing GraphQL mutations is equally...

...and decide if any of it needs an update. Your main components (e.g. Ruby, Rails, Unpoly) should always be reasonably up to date. Keeping your dependencies up-to-date is...

job_id: job.job_id, executions: job.executions, queue_name: job.queue_name, url: url, }, ) end Rails.application.configure do # Also capture errors not handled by Active Job config.good_job.on_thread_error = ExceptionNotifier.method(:notify_exception...

...in webpack.config.js: { ... optimization: { minimize: true, minimizer: [ new TerserPlugin({ terserOptions: { ..., mangle: { properties: { regex: /^[_#]/ } } } }) ] } } Configuring Webpacker (Rails) To configure Webpack to mangle private properties, make a change to your Terser configuration in...

...like above: new(str, safe_level=nil, trim_mode=nil, eoutvar='_erbout') Difference between Rails mailer and ERB Rails mailer <% if true %> <%= 'bar' %> <% end %> <%= 'foo' %> <%= 'bar' %> bar foo bar

makandracards.com

In medium-sized to large Rails applications, asset compilation can take several minutes. In order to speed up deployment, asset precompilation can be skipped. This card automates the process.