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.
Mongoid (MongoDB) has_many/belongs_to relation and wrong index being picked
If you have issues with your Mongoid relations and wrong indexes being picked, you may want to look here: Mongoid (MongoDB) has_many/belongs_to relation and wrong index being picked.
Release Candidate 2 for middleman-presentation 0.16.0
I just released the second release candidate for <a href=”https://github.com/fedux-org/middleman-presentation”middleman-presentation 0.16.0</a>. Detailed information about changes made can be found in the RELEASE_NOTES.md.
Refactoring Controller Helper Methods
I just recorded a screencast where we take a look at refactoring controller methods into a much more organized format.
railsbox - Ruby on Rails virtual machines configurator
I’ve created a small tool to configure virtual machines for Ruby on Rails development - railsbox.io. It uses VirtualBox, vagrant and ansible under the hood.
Debugging Super Methods with Ruby 2.2
Debug more, quicker with the new debugging super_method introduced in Ruby 2.2.
search_cop v1.0.5 is out
I just released a new version of search_cop. v1.0.5 is a bug fix release that fixes issues regarding quotation. Read more
Tropical Ruby 2015 announces its full lineup
Tropical Ruby 2015, the beach Ruby conference announced its full lineup, including talks, workshops and activities.
When edge cases poke holes in your perfect solution
You found the perfect solution to your crazy testing problem. All you have to do is override DEFAULT_HOST, and you’ll be in business. Except that you have to turn off warnings. And you have to figure out that one test where you don’t want to override the host. And then… Except… Read more
A menu system using Pundit
A blog post about we wrote a menu system that incorporates the Pundit gem for permissions, based on Rails’ routes parsing.
Recalculate counter cache columns in Rails
Rails has this great feature called counter_cache. When you have a has_many/belongs_to relationship between two models, it basically lets you say that you want to save the number of associated objects on the has_many side. So if you have Post has many Comments, you can do post#size and no SQL query is executed, Rails simply just looks at the comments_count field of the post. Read more
gauguin - a RGB image colors counter (a new gem created by Ania Ślimak)
gaugauin gem, created by Ania Ślimak, helps you count colors of a RGB image. It allows you to count a realistic number of image colors or to create color palettes based on images. Useful in apps for e.g. printing houses, promo agencies, designers. Read more
Understanding some Enumerable methods by implementing them in Ruby
Want to learn how to use Enumerables? Time to learn by building the Enumerable module yourself. Check how you could build the methods implemented at Enumerable yourself and use them in your code.
Spyke: A pretty good, full-featured ORM for API-backed apps
Extracted from an API-backed Rails app currently running in production, Spyke provides an ActiveRecord-like interface for interacting with REST services. It comes complete with features I was unable to find in other solutions, such as properly working scopes, customizable associations, ActiveRecord-style log output, fast JSON handling, etc. View Spyke on GitHub
Code Quality: Metrics That Matter
The Ruby ecosystem has dozens of tools for evaluating the quality of your code, but there’s a lot of variability in their usefulness and ease of use. Here are some that I’ve found to be both important and easy to integrate into my development workflow.
More than 101+ Ruby and Ruby on Rails Blogs 'n' News Sites (w/ Feeds) @ Planet Ruby's Sources Page
Hello, I’ve added a sources page to the Planet Ruby that lists more than 101+ ruby blogs and news sites w/ feeds. Anything missing? Let us know. Happy planet. Cheers.
How to do phone verification using SMS via Twilio
A step by step guide on how to do phone verification using SMS via Twilio. Read the full article here.
OAuth2, Google and Ruby
A step-by-step guide on authorizing YouTube API access using Ruby.
using select, reject, collect, inject and detect
If you are getting started with Ruby, looping through arrays and hashes ‘the ruby way’ should be one of your first goals! Read the full article here.
How to install and use RVM
I’ve outlined how easy it is to install and get started with RVM as well as why you should do it. Read the full article here.
loaf v0.4.0 release
loaf manages breadcrumbs in Rails app. This release cleans up api as well as internals and gets tested on all major ruby and Rails versions. Enjoy!
Build a Pocket Clone: Part 2
Part 2 in building a clone of the url reader application Pocket
Everything You Should Know about Asset Pipeline
Check out our new blog post on how to work with Rails Asset Pipeline. We covered basic usage, file structure, pre-compilation, asset helpers and finally, some gotchas to watch out for. Read more
The good and bad of paid acquisition
Product people usually stay away from buying traffic to promote products. That’s because they don’t understand how it works, or underestimate how it might help accelerate growth. In this article, I discuss the good and bad of buying traffic to promote digital products, ebooks and apps. After reading this article, you’ll at least get rid of your prejudices against paid acquisition and become more comfortable with the idea of using paid acquisition to get more customers.
parelation.js
parelation.js: an ActiveRecord–like API to access backends built with parelation gem.
Using fallback fonts in Prawn
I just wrote a new post about Fallback fonts in Prawn on the CookiesHQ site.