The Ruby and Rails community linklog
Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!
Submit a post
Post Preview
Note: Only the first pargraph is shown on the front page and overly long paragraphs may be broken up.
Easily output tabular data in HTML, CSV or XLSX
My new gem dining-table allows you to easily create HTML tables based on clean table classes instead of messy views. The same table classes can be used to export the data to csv and xlsx. Check it out if your app needs to handle or export tabular data.
Keep it simple, stupid
We both know that KISS principle along with the time we’re working. Recent months, I have more in-depth recognition about it. I would like to show a few examples to elaborate more from different aspects.
Named Regular Expression Captures in Ruby
This is a short article outlining how to use named captures when you are using the match method… allowing you to assign a name to what you are extracting.
New Beta of "Take My Money" available
Beta 2 of Take My Money: Accepting Payments on the Web by Noel Rappin is now out. [more inside]
Zip S3 in ruby, streaming VS download
We’ve recently had to generate zips in Ruby from files present on S3. Since various documentation sources were out of date, we’ve written a HOW TO, including the 2 example of download files and zip + zip streaming.
How To Conditionally Send Emails With Rails ActionMailer
Ever want to disable only the sending of emails for a particular length of time, different environments, or for any other reason? This article describes conditionally sending your emails using a simple before_action in Rails. https://solidfoundationwebdev.com/blog/posts/how-to-conditionally-send-emails-with-rails-actionmailer
The contents of my ~/.railsrc and why
The ~/.railsrc - a file that stores your default preferences for rails new - must have passed me by on its arrival years ago with Rails 3.2 and from what I can gather it’s also underutilised by other experienced Rails devs. It’s time to evangelise, here’s the contents of my ~/.railsrc and why.
Managing Private Dependencies with Bundler
Bundler, a great resource for managing dependencies in your Ruby projects, helps verify compatible versions of your gem dependencies. Read more here.
Efficiently and Conveniently Building Ruby and Node.js Application Docker Containers
In this Phusion article we show how we build Docker application containers in two steps and explain why that is a useful thing to do. We then walk you through writing a build script that not only builds an application container but also runs its unit tests, checks with the source repository for conflicts or unchecked changes and tags and pushes the final image to the container repository. [more inside]
Migrate from delayed_job to Sidekiq
Step by step tutorial why and how to migrate from delayed_job to sidekiq? It also covers Devise and Capistrano
Managing ActiveRecord connections with Octoshark
Octoshark is a simple ActiveRecord connection manager. It provides connection switching mechanisms that can be used in various scenarios like master-slave, sharding or multi-tenant architecture.
Examining The Internals Of The Rails Request/Response Cycle
Come with me on a journey through the internals of Rails, as we trace a request from the web server to the controller action method, and follow the response back again.
The Ruby Gems I'd Rather Not Live Without
There are thousands of Ruby gems out there, each one built to solve a specific problem. Every project has a unique Gemfile, but here are my staples.
Scout releases ScoutProf: turbo-charge your transaction traces
If you use rack-mini-profiler or New Relic, you’ve probably seen a big ‘ol block of “executing action” or “Controller” time and wondered: “what’s happening here?”. ScoutProf builds on the rb_profile_frames() api to break down time spent in your custom Rails code.
gem TheRole v3.5 has been released
TheRole v3.5 (Authorization for Rails + GUI) has been released https://github.com/the-teacher/the_role . New version is ready for Rails 5. [more inside]
Little-known but Useful Rails Features: ActiveRecord.extending
Every now and then I discover some features in Rails that are not that (arguably) commonly used, but there are some use cases when they turn out to be super useful and the best tool for the job. One of them would definitely be a nice addition to ActiveRecord::QueryMethods - extending method. Let’s see how it could be used in the Rails apps [MORE INSIDE]
Introducing Traver — test data generation framework
Opposite to FactoryGirl Traver has number of advantages. Look them up at our github repo.
How to call services asynchronously in Ruby?
Sometimes you want to retrieve data from different sources at once, why not to use threads to do that in parallel? In this example you can see how to use concurrent-ruby and dry-monads to write asynchronous code in Ruby. You can also compare it to Java version.
Rails 5 disables autoloading after booting the app in production
In Rails 5 autoloading is disbaled after booting the app in production mode by default [more inside]
3 Simple Ways Experts Succeed With Rails Framework
If you’re serious about achieving your professional goal of removing “Junior” / “Intermediate” from your title faster, model the way you learn and work after the best in the profession. [more inside]
Replacing controller specs in Rails apps
I kicked off a series on ways to replace RSpec controller specs in Rails applications. Part one looks at request specs, more coming in the next few days!
[Screencast] Capturing Signatures with Signature Pad
Using the Javascript Library, Signature Pad, learn how to capture user signatures and store them within your Ruby on Rails application. https://www.driftingruby.com/episodes/capturing-signatures-with-signature-pad
The Last Rails I18n Guide You’ll Ever Need
In this article we will discuss how to add support for I18n in a Rails application, where to store translations, what localized views are, how to format dates and times, how to introduce pluralization rules and more. Continue reading…. https://phraseapp.com/blog/posts/last-rails-i18n-guide-youll-ever-need/
Quiet Assets in Rails 5
Remove the quiet_assets gem from your Rails app and upgrade sprockets-rails, which now includes a configuration option to silence the asset request logging in development. https://rossta.net/blog/quiet-assets-in-rails-5.html