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.
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
Manage Your Project's Environment Variables
How to use dotenv gem to manage your environment variables. [more inside]
Ask RubyFlow: Function as a service for Ruby?
Hi Folks, Do you use / know of any services like AWS Lambda that supports Ruby out of the box? [more inside]
football.json - New 2016/17 Season - Free open public domain football data in JSON
Hello, I’ve updated the /football.json repo / service that offers (auto-)generated match schedules (fixtures and results) and club listings for the major football leagues e.g. English Premier League, Deutsche Bundesliga, Primera División, Italian Seria A, etc. See the 2016-17 season folder for (static) JSON examples. No API key required ;-) All data public domain. Enjoy the beautiful game. Cheers. PS: Ruby works great for generating JSON; see the json.rb script for the code.
From monolithics to microservices.
This is not another post about application architectures but a software design instead. I bet you are a bit lost with the heading, keep reading, I will take you there. Read more
Building Rails API's With JSONAPI and JSONAPI-Resources
An article bringing together all the pieces I needed to understand how everything works. It finds the middle ground between specification and rote tutorial. [more inside]
How to Create a Polymorphic Whodunnit on PaperTrail
PaperTrail’s versioning and whodunnit to track auditing is fantastic. However, it falls apart if you have multiple user classes, such as Admin and User. Read on to keep your auditing trail clean and exact. [more inside]
How to Reduce Controller Bloat with Interactors
https://semaphoreci.com/community/tutorials/how-to-reduce-controller-bloat-with-interactors-in-ruby
Handling acronyms in rails
The ActiveSupport::Inflector handles a lot of the semantic rules in Rails, including acronyms. Continue reading…
Rails: Implementing a State Machine
State machines can come in handy for many situations. In this episode we show you how to implement a simple state machine using ActiveRecord Enum.
Get Your Data to Glass 180x Quicker: Rails, JSON and Clusterize.js
Displaying large, complicated reports was taking 6+ minutes to render in Chrome. I sped it up 180x using Rails to serve cached partials to Clusterizet
Tech Book Face Off: Design Patterns in Ruby Vs. Practical Object-Oriented Design
In this book review, I take a look at two older, but popular books on programming in Ruby. They are both well written, and I end up comparing them to numerous other books I’ve read on software design in addition to setting them against each other.
Ruby Podcast Episode 12
Learn about lambda calculus, advanced sql in rails, mutation testing, new rails 5 framework defaults and more in the Ruby Plus podcast episode 12
Implementing the Bit Array Data Structure in Ruby
In this article, I will explore how to implement the Bit Array data structure in Ruby, and compare its performance to the implementation in the bitarray gem, which uses a more efficient, but slightly more complex implementation. Continue reading…