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.
Level Up Your Command-Line-Fu With Ruby
To really master the command line you have to master dozens - if not hundreds - of small utility programs. Fortunately, it’s possible to replace a lot of these single-purpose tools with a general-purpose programming language like Ruby. This post will show you how you can use your Ruby skills to level up your command-line game. http://blog.honeybadger.io/ruby-unix-command-line/
Speeding Up Bulk Imports in Rails
Leigh Halliday shows ways how to speed up bulk imports in Rails.
Inline form validations in Rails from scratch
Are you stuck with the ancient “after submit” validations and no javascript plugin does the trick and provides inline validations? Implement your own! In this blog post I show a way of implementing inline validations from scratch. [more inside]
4 ways to get the most out of your Rails logs
Logging is the lowest common denominator of monitoring. The downside of being a logging addict: logs can quickly become a noisy mess. Learn how to turn your Rails logs into a drool-worthy debugging tool.
Working with dates on Ruby on Rails
Working with dates can be hard. You need to consider time zones, understand how to store dates in your database, parse strings into dates or even format dates and display them to the user. And there’s the daylight saving time. See how to properly work with dates.
What's new in Ruby 2.3?
Ruby 2.3.0 will be released this Christmas, and will introduce some new features like the safe navigation operator and immutable string literals. Here’s a look at all the new features coming up: http://nithinbekal.com/posts/ruby-2-3-features/
A christmas tree formatter for RSpec!
We wrote a formatter for RSpec that outputs the familiar dots that you might be used to seeing , but in the form of a christmas tree; a great way to bring some holiday spirits into your test suite! A short blog post about it is on the Elabs blog: http://www.elabs.se/blog/76-a-christmas-tree-formatter-for-rspec The code is available on GitHub: https://github.com/elabs/christmas_tree_formatter
Rails Anti-Pattern: Fat Decorator
Using decorators in Rails makes models less fat and views less complicated. But what if the decorators become fat? Read on to learn how large decorators hurt your codebase and what you can do about it.
Demystifying the Gem Version Comparison
Learn how ruby gems implements the gem version comparison by reading the article : Demystifying the Gem Version Comparison
Rails Authentication with CanCan
CanCan is one such Ruby gem which is an authorization library restricting the resources specific users are allowed to access. CanCan gem checks whether user or a resources has permission to access the file or not. Read full at RailsCarma Blog
Use inverse_of with your ActiveRecord associations
Learn about the :inverse_of
option for ActiveRecord associations and why it is important. Though Rails will try hard to set this option up automatically on your behalf, it doesn’t always work. This uncertainty may make you uncomfortable - find out what you can do about it. https://rossta.net/blog/use-inverse_of.html
RubyConf 2015: The Hows and Whys of Immutable Data Structures
Immutable data structures give us peace of mind, but using them is challenging. How do you build an immutable list? Why would you use one? Join us and learn what makes a data structure “persistent”, the holy grail combination of immutability and performance. We’ll see not just how to use them, but also why they’re a good idea and how they work. Most importantly, we’ll see how these data structures are useful in real-life programming scenarios. Master this cornerstone of functional programming and learn the answer to the ultimate riddle: how do you change a list while leaving it unchanged? [more inside]
How to use Rails Strong Parameters
In the latest major version of Ruby on Rails, Strong Parameters were introduced. The intent of this addition was to enable consistent and reliable parameter checking. Using Strong Parameters is simple and intuitive. It provides a very clean method API to help keep controllers DRY.
Using La Maquina to solve complex cache dependencies
Let’s talk about caching a page that has a ton of database objects that need to be pulled. Specifically, because that page render is centered around a monster model that has way too many dependencies.
Time difference in Ruby on Rails
How many minutes has passed since the beginning of this job? How many hours do we have to wait? If you’ve asked these kind of questions while programming on Ruby on Rails you’ll probably get no answer on Rails docs. But there is a solution. [more inside]
How to compare version strings in Ruby
Sometimes you need to support different versions of an API inside your ruby code. And, sometime, you will need to compare version strings in order to make a feature available. But how do we compare if a version is greater than another one? It’s simple: use Gem::Version! [more inside]
Asset Pipeline in a Bash Script
Quick experiment inspired by @garybernhardt’s tweet: http://pchm.co/bashing-the-asset-pipeline/
Wye Tech News #1
This new weekly blog issue contains a list of interesting articles and news related to Ruby, Rails, JavaScript and web development related stuff in general that we found during the week. [more inside]
Breaking the News: Wisper + Pub-Sub
As Rubyists, we often find ourselves trying to figure out the best way to both abstract out logic into self-contained components, as well as how to effectively send messages between objects. The publish-subscribe pattern is one solution to this problem, though it is far less common in Rails applications. This blog post looks at how to implement pub-sub in Ruby by using the wisper
gem
How to manually set the ID of a record when Creating or Seeding in Rails
How to manually set the ID of a record when Creating or Seeding in Rails. http://solidfoundationwebdev.com/blog/posts/manually-set-the-id-of-a-record-when-creating-or-seeding-in-rails
How to get a records rank in Rails
How to get a records rank in Rails such as getting a users highscore rank. http://solidfoundationwebdev.com/blog/posts/how-to-get-a-records-rank-in-rails
How to Allow API Requests from Anywhere in Rails
How to Allow API Requests from Any Address in Rails. http://solidfoundationwebdev.com/blog/posts/allow-api-requests-from-anywhere-in-rails
The Definitive Guide to Ruby Heap Dumps, Part II
In part 2 of this series, Richard Schneeman generates a heap dump off of a Heroku dyno and analyzes it.
Fun and Practical Alfred Workflows in Ruby
Screen scraping, currency conversion through an API, and natural language calendar events. http://www.sitepoint.com/fun-and-practical-alfred-workflows-in-ruby/
Introduction to Refactoring
This article provides examples of basic refactoring techniques like extract method. http://www.blackbytes.info/2015/12/ruby-refactoring/