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.
Agile Web Development With RailsBricks 3 and Rubyonrails.link
Get started with Rails Bricks http://www.matthewreichardt.com/ruby-on-rails-agile-web-development-with-gems/ and with http://www.rubyonrails.link community
Default values in Hash
A quick introduction that explains what “default value” options are available on Hash and when to use them!
The problem with dependency injection
I’ve written up a blog post about the way how I deal with the construction of the dependencies http://codingwithaxe.com/the-problem-with-dependency-injection/
You've got the Rails basics. So why do you feel so slow?
You’re confident about the core ideas behind Rails. You can write working code, no problem. But now that you care about testing, maintainability, and design, it fels like it takes you way more time to ship anything! Why do you feel so slow? And how can you ship quality code, faster?
Working Effectively with Data Factories Using FactoryGirl
Exploring patterns that can help you use factories more effectively with examples based on Ruby’s FactoryGirl. https://semaphoreci.com/community/tutorials/working-effectively-with-data-factories-using-factorygirl
How To Create A Gem For Javascript And CSS Libraries
Ever used an obscure frontend library that doesn’t have a gem but wish it did? Here’s how to create a gem for a Javascript or CSS library.
Refactor to concepts
Anyone can write hard to understand code but think about helping your future self by making your code cleaner and more readable. Follow this simple step-by-step refactoring and then you can use the same strategy to make your code more understandable.
How Arel Converts Ruby Queries Into SQL Statements
Pat Shaughnessy shows how Active Record uses the Arel gem to convert the ActiveRecord::Relation object describing your query into a string containing a SQL statement. [more inside]
Conway's Game of Life.
This is a Rails implementation of “Conway’s Game of Life.” [more inside]
How good are your Ruby tests? Testing your tests with mutant
We write tests to avoid regression bugs. If that’s so important then do we test our tests? What is test coverage exactly? Is line coverage of any use? How does mutation testing fit here? I’m trying to answer those questions in my last blog post: [more inside]
Painlessly import themes into you Rails app
I just finished writing the first version of my new gem theme_importer_rails which allows you to import a bootstrap theme (or any kind of theme) into your Ruby on Rails application with one command. Please try it out and leave feedback. PRs are welcome as well!
Volt 0.9.3 Released with Support for Clustering, Simplified Persistence and Improved
The volt framework is progressing quickly as we move towards 1.0. We cover all of the changes in our latest blog post.
Decoupling CSS Selectors From Your Tests
For a long time, I’ve been bothered by the problem of using CSS selectors to target DOM elements in my tests (with Capybara). In this short article, I’m going to try Eduardo Gutierrez’s suggestion of using data attributes for targeting DOM elements instead of CSS selectors. Check it out
Refactoring to Reveal Rails Group_by
Refactoring is a humbling process – especially when you write a 10-line method only to discover that it already exists! This blog post refactors some bad code to reveal the Rails group_by method in all its glory.
How to Deal With and Eliminate Flaky Tests
Randomly failing tests are the hardest to debug. Here’s a system you can use to fix them and keep your test suite healthy. Read it here!
The Rational Command-Line Parser
$ ruby example/parse.rb -x 3 -y 4 -n5 -abc --beep=boop foo bar baz # =>
{ :_=>["foo", "bar", "baz"],
:x=>3,
:y=>4,
:n=>5,
:a=>true,
:b=>true,
:c=>true,
:beep=>"boop" }
Hitting real Angular http service from Jasmine test
Simple example about how to create tests for real services in Jasmine tests.
Cells 4.0 – Goodbye Rails! Hello Ruby!
Cells 4 got released. This version is completely decoupled from Rails, and allows view components in any Ruby environment. Read the release post and why it still allows to use Rails view helpers, why it’s faster than ActionView and where we’re going from here.
Design is Refactoring: Replace array with object
Refactoring, primitive obsession and method parameters. This week it’s time to look refactoring away Arrays and Hashes
Object Oriented Design Basics
How to apply Open Closed Principle to FizzBuzz and eliminate if-else-elsif statements.
Using Struct and OpenStruct
Sometimes you just want an object that can store some data for you, the struct class is very useful in this situation. http://www.blackbytes.info/2015/06/using-struct-and-openstruct/
Awesome Ruby Events - Summer Update (Incl. Italy, Vietnam, Colombia, etc.)
Hello, I’ve updated the Awesome Ruby Events list that collects Ruby events (meetups, conferences, camps, etc.) from around the world. New entries include: Ruby Vietnam, RubyDay Italy, ROSSConf Berlin, RubyConf Colombia and more. Full list. Anything missing? Contributions welcome. Cheers.
RubyDay 2015, the Italian Ruby conference
On November 13th, 2015 the RubyDay will be held in Turin. It’s the only Ruby conference held in Italy and it’ll be a great place to meet other developers and companies, learn some new tricks and have fun altogether. If you feel like having a talk the Call for Papers is still open!
React and CoffeeScript (cjsx) on Middleman
React and Middleman are not a common pair, but when working entirely on the front-end and digesting a Rails API, it’s really advantageous to stick with a stack you already know. The only viable alternatives are vanilla everything or a js stack. This tutorial will get you up and running so that you can use React with CoffeeScript compiled by middleman and deployed on heroku.