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.
How to test a function that yields a block with Minitest and Rspec
Have you ever tried writing a test for a function that takes a block and does something to that block? I recently had to do that same thing and found there was not much written about it so in this post I’m going to fix that, I’m going to show you how to create expectations on block arguments. Read the article.
Integrating Trailblazer and ActiveRecord transactions outside of a request lifecycle
When you use Ruby on Rails with ActiveRecord, you can get used to having separate transaction on each request. This is valid also when using Trailblazer (when inside of a request scope), however Trailblazer on its own does not provide such functionality. It means that when you’re using it from the console and/or when you process stuff inside background workers, you no longer have an active transaction wrapping around an operation. Here’s a blog post I wrote on how to add such functionality into your operations.
"Ruby Web Dev: The Other Way" guide
I have started my personal guide to give a junior/middle Ruby wed developers a brief insights on different aspects: from Ruby code architecture to Frontend and DevOps. All the things that I consider viable for a modern Ruby Web Developer. As soon as some topic appears in our team’s internal discussions, and it has pros/cons - it is transferred to this guide. [more inside]
Improving Large Rails Apps with Service Objects
Nothing has improved my Rails apps more than service objects. A couple of weeks ago, I was asked to help out with an established Rails app. I found a User model that included 28 modules. All but 8 were namespaced under Users. A core object in your system, used everywhere, and it’s thousands of lines long. Madness like this can be sidestepped with service objects. Find out how.
Unobtrusive JavaScript via AJAX in Rails
Daniel Clark explains how you can update a dynamic webpage in JavaScript using AJAX in Rails.
Octopod (Jekyll Podcasting Theme) Relauchned - Build Radio Show Sites in Ruby
Hello, At yesterday’s Vienna.html (static site) meetup Stefan Haslinger presented the updated and “relaunched” Octopod Jekyll Podcasting theme. What’s included? [more inside]
A Guide to Ruby Gem Post-Install Messages
New article on Ruby Gem Post-Install Messages. Hope you enjoy!
Oracle support for ajax-datatables-rails
Add oracle support for gem ‘ajax-datatables-rails’, see: https://github.com/paoloripamonti/oracle-ajax-datatable
Generate AWS - S3 Policy and Signature
S3 accepts uploads via specially-crafted and pre-authorized HTML POST Form. [more inside]
Using Bumbler to Reduce Runtime Dependencies
If your project uses Bundler, Bumbler shows you your project’s largest dependencies. You can maybe get rid of some of your largest/slowest dependencies by manually requiring them when you need them. See how it works: http://www.ombulabs.com/blog/ruby/performance/using-bumbler-to-reduce-runtime-dependencies.html
How to specify local Ruby gems in your Gemfile
The popular approach to pointing your Gemfile to gems on your laptop is to use the :path
option. Though it works in a pinch, you can run into problems when you use :path
. In this post, I’ll show you a better way to develop against local Ruby gems. https://rossta.net/blog/how-to-specify-local-ruby-gems-in-your-gemfile.html
From Rails to Hanami Part 3: Sidekiq Workers, Sequel Plugins, I18n, Timezone issues
The final chapter of the Rails to Hanami migration saga http://rpanachi.com/2016/04/25/from-rails-to-hanami-part3-sidekiq-workers-i18n-timezone-issues-core-ext
Memdump - basic analysis of Ruby objectspace dumps
Memdump provides basic tools to analyze Ruby memory dumps (from ObjectSpace.dump_all). It’s basic, but it helps !
Hebillas, the thoughbot Suspenders companion
We do our fair share of Rails new in the office. When we discovered Suspenders, we though we did found the holy grail solving all our problems. But Suspenders is also very opinionated. Instead of trying to maintain an active fork of it, we’ve decided to maintain a template on top of it, and it works quite well. Check https://github.com/cookieshq/hebillas for more details.
How to receive webhooks in your Ruby on Rails application - Part 1
Webhooks are very simple. A Webhook is an HTTP callback triggered by an external application to your application (or vice versa). For one of our app, we’ve had to integrate a few of them and we wrote a quick tutorial on how to receive them.You can read on our blog
Rails 5 - Whats in it for me?
I did a webinar on new features in Rails 5. Check http://blog.bigbinary.com/2016/04/22/rails-5-webinar.html for more details.
Jekyll-Timeago new release (v0.9.0)
Just pushed a new version of Jekyll-Timeago, a library to compute distance of dates in words (originally built for Jekyll and Liquid based templates). [more inside]
Bootstrap 4 will be in Sass. Here is how to directly integrate it into Rails
Did you know that Bootstrap is switching from Less to Sass? Well that means we will be able to use it directly inside Rails. Read my post for how to do it or head straight into gem documentation because it’s really super easy
Cucumber Characteristics 0.5 released
Just released an update to cucumber_characteristics supporting cucumber 2.1+ and newer ruby versions (1.9+). cucumber_characteristics allows you to fully profile your cucumber test runs enabling you to understand exactly where your test time is going. This is a formatter and should drop into your existing setup transparently generating a html and/or json reports. [more inside]
Thredded: a new Forums Engine
Thredded is a Rails 4.2+ forum/messageboard engine. Its goal is to be as simple and feature-rich as possible. [more inside]
Why I won't leave Ruby for Elixir
My feelings on some aspects of the Object Oriented vs Functional Languages discussion. Explored from the view a Ruby developer working with Elixir. http://insights.workshop14.io/2016/04/18/why-i-cant-leave-ruby-for-elixir.html
The Road to Sinatra 2.0
Let’s talk about the current state of our beloved Sinatra library, and our big (ok not so big) plans for the next major release.. TWO POINT OH! [more inside]
Spreadsheet Architect v1.3.0 Released
This version adds support for setting model and project wide defaults. Spreadsheet Architect makes it super easy to turn any ActiveRecord relation or plain ruby object array into a XLSX, ODS, or CSV spreadsheets. Generates columns from model ActiveRecord column_names or from a given array of ruby methods. https://github.com/westonganger/spreadsheet_architect
CarrierWave, Cloudinary and the path to Image Manipulation Enlightenment
We recently used Cloudinary for a Rails project, and really liked how easy it makes programmatic image manipulation. There are some quirks to using it with with Rails/Carrierwave, so I wrote a blog post summarizing our experiences. Hope you enjoy! [more inside]