RubyFlow : The Ruby Community Blog

Home   Submit   Sign Up   Log In   leaders   Twitter   RSS Feed  
August 01, 2014
Last night, I set up an SEO keyword tool and a Twitter+Facebook retargeting tool for seven different websites. Both tools require I add JavaScript snippets to my websites but I didn't touch my codebases or deploy anything new.

I got it done by using, which I've been using for about a year as the primary "Adapter Pattern" for all analytics on my Ruby on Rails apps, Middleman apps, Rack apps, and other static sites. I have Google Analytics and Intercom set up through it and all kinds of other email, customer retention, and analytics tools.

In sum, those tools help me understand whether the things I've built are things that any users or customers actually want, helps me drive traffic to them, and help me grow the products.

Sometimes it's better to interact with from the server-side, though. In and Ruby, Josh talks about how to do it cleanly and in a testable way from inside a Rails app, with RSpec matchers.
Yukihiro “Matz” Matsumoto, Chief Designer of the Ruby Programming Language is presenting on Ruby.Next at the Ninefold offices in San FranView the live stream at 7pm (PDT).
July 31, 2014
I wrote a short article about resetting the auto incrementing id in a Rails app using PostgreSQL after importing old data in a new app.

I hope it saves you some time.
I wrote a small tutorial on formatting and displaying dates to users or customers. Hopefully, it's helpful.
Representable is a mapping gem to transform Ruby objects to and from hashes, JSON, XML, and YAML. This blog post explains the new features in the 2.0 release.
We've just posted a basic list of simple practices you can apply that will take you towards the goal of bulletproof-security (this is not a complete list, but something to get you started), take a look at Simplest Security Best Practices .
July 30, 2014
I'm proud to announce the initial release of Roda, a new ruby web framework based on the following ideas:

1) Use a routing tree, similar to Cuba and Rum
2) Make it easy to use like Sinatra
3) Make it extensible like Sequel
4) Avoid namespace pollution

Find out why you should use Roda
attr_searchable, the gem to add database agnostic fulltext search to ActiveRecord (for Mysql and PostgreSQL) is a young and ambitious project. As its set of features grew, it has become neccessary to change its DSL and name. Thus, 'attr_searchable' is called 'search_cop' now.

In addition to the new name, search_cop v1.0.0 is out now and ships with search_scope's:

Check it out and install or migrate to 'search_cop'
How to Pick Languages
Adam Keys shares our latest GrowingDevs article on some techniques for picking languages. While not strictly about Ruby, this is a great guide for finding a language to try next.
I just published a tiny "how to": Google Analytics API access via Ruby (on Rails). Hope it helps some people!
Facilitate change in your Ruby code with the Single Responsibility Principle.
I wrote about Refactoring Logic from a Rails View. Hope you enjoy!
I just wrote a piece about the pattern we use to write maintainable JavaScript in our Rails apps. Have a read and let me know what you think.
Created 1 year ago the Shortcode gem has new hit version 1.0.0. Thanks to the community for submitting pull requests, bug reports and feature requests the gem has matured and become more full featured in it's year of existence. Features of note include:

* Simple and easy to use, renders templates with passed in attributes
* Custom helpers (like rails view helpers)
* Presenters
* erb, haml and slim template support

Hopefully next year will see just as much community participation and improvement to the gem.

Find out more
This project helps you to build wonderful presentations based on HTML and JavaScript.

The JavaScript-part is powered by reveal.js, a great framework to build HTML-/JavaScript-presentations. The infrastructure behind middleman-presentation is powered by middleman, a flexible static site generator which also offers a live preview of your presentation.

* Seperates style/assets from slide content by using bower
* Has a slide creator (Markdown, Erb, Liquid)
* Helps you to initialize new presentations
* You can have your own templates for (new) slides
* Allows to group slides
* Integrates with your preferred editor

Ruby >= 2.1.0

Read on...
Several months ago we were reaching a critical point in Art to Aid’s development. We had begun using Shopify about six months prior to test our theory that creatives and consumers want to work together to create good in the world; at least ten percent of every sale on Art to Aid goes to support a charitable organization of the artist’s choosing. We were closing in on flipping the switch on our own custom platform built on the popular Ruby on Rails ecommerce platform Spree. I had been happily denying the need for a deployment strategy more complex than a capistrano task pushing out to a single VPS. Continue reading blog
July 29, 2014
Sunny San Diego this year from November 17-19, 2014.

Registration is now open
Memoization is really common in Ruby, but the most popular pattern for memoizing method calls has some major flaws. I wrote about some of the more advanced patterns you can use to memoize your method calls, and show some interesting Ruby tidbits along the way.
I just wrote about 7 useful custom ActiveModel validators. Let me know if you've used similar ones or have any to contribute.
We wrote a new tutorial on how to use Capistrano 3 to deploy Rails apps.

Deploy Rails Apps with Capistrano 3
I found this below article interesting as well as helpful.
Rendering data content via JavaScript template using Dust.js

Please provide your feedback on the same.
a9n is a new gem, which helps to keep ruby and rails app configurations easily maintainable, verifiable and clean. Created by Krzysztof Knapik (@knapo).
A handy list of the most popular open source Ruby on Rails projects (ranked by the amount of stars on Github) - Most Loved RoR Open Source Projects.
I just created a Medium Collection ABC of Ruby on Rails. I need your feedback and suggestions. Thanks!
July 28, 2014
Ruby Gems are essential for every Ruby on Rails programmer. They are a small pieces of already written and tested code which provide some functionality. For example, there are many gems which provides admin interface for your app. It means that you instal the gem, make some basic setup and you ... Continue reading
I wrote an article on some tips I picked up with working on legacy Rails apps. I hope you like it!
I just released a new screencast about using jQuery UJS and AJAX in your Rails apps.
Scalable code without bloat: DCI, Use Cases, and You
July 27, 2014
Using factories is nice to simplify your specs, but you should be careful with the mutable objects you could be reusing there.
github_api v0.12.0 just released!
I've released github_api gem after few months of rewriting internals. It has magical unicorn logo!

The most notable improvements are in parsing of method arguments to allow for flexibility when specifying required parameters. Many new api calls have been added to match current GitHub API. Some major bugs have been fixed connected with making requests. Please see changelog for specific changes.

I'm looking forward to your feedback as this library is heading towards 1.0.0 release.
The Law of Demeter
I wrote a blog post explaining the Law of Demeter with a simple example in Ruby.
Hello, Using a Ruby build script (that is, Rakefile) I've built up a GitHub org, that is, football.csv - for open football data in the CSV (comma-separated values) format, that is, plain old text. Leagues include the English Premier League, Championship, Bundesliga, Eredivisie, Süper Lig, Primera División, Pro League etc. for 10+ seasons (e.g. 2013/14-1993/94). Cheers.
I wrote a blogpost on Timeout Internals for CRuby to help people understand when it works and when it doesnt.
We wrote a blog post on how to work with Ajax on Rails. If you are beginning to build Rails apps you may be surprised how easy it is to get this going.

The Detailed Guide on How Ajax Works with Ruby on Rails
July 25, 2014
I wrote a small tutorial about how to create and calculate trial periods in Ruby.
Rails tips: #with_options
One of ActiveSupport's useful methods, #with_options allows you to DRY out hashes passed to a collection of similar method calls - ideal for complicated has_many declarations. Read more on the Cookies HQ blog
The new HTML sanitizer in Rails 4.2
Learn how the Rails HTML sanitizer was revamped using Loofah and how t will look like in Rails 4.2.

Read the full blog post here.
This week/s I have been mostly struggling with an outage in our primary care giver, realizing that my family is not really highly available and has no real disaster recovery plan. Roll on Spring, I say after a hard month of Sickness as a Service. I also went to the Docker meetup in Melbourne, which was excellent. Docker. So hot right now. Read the rest of the Vibe
Version 0.99.6 of Mustache has just been pushed to Rubygems.

Thanks to the work of several contributors, this release contains bugfixes hitherto unreleased as well as 1.9.3+ compatibility. A more thorough list can be read in

Work will continue to release the next version, which will be numbered 1.0.0.
July 24, 2014
Ruby is a fantastic language. Even when you think, you know all about it, you discover new ways of making your code more elegant. We've prepared a list of such features:

Hidden features of Ruby you may not know about

Did you know all of them?
This article details how you can easily and automatically scale your website images to the resolution most appropriate to your viewers mobile devices or screen pixel density. Code samples included for Ruby on Rails and jQuery.
To widen the scale of your business and get the advanced Ruby on Rails web development solutions, CSSChopper is the best company. Our emerging RoR development solutions aid you to achieve your diverse challenging business goals successfully. For more details, visit:
I put together a list of interesting applications built with Ruby on Rails.
A helpful post on Multi-tenancy in Rails by Allerin

Please provide your feedback if you find it helpful.
New blog post: Code Coverage Tools For Padrino.
July 23, 2014
We're thrilled to announce that we've partnered with Heroku for the 2014 Rails Rumble! Read all about this and our other announcements on our blog.
I just posted a technique for handling failure when doing things like importing third-party data or generating reports.
July 22, 2014
The Rails ecosystem moves fast, way too fast for print. If you're like me, you want to learn the most recent version of your frameworks and gems. But the best resources are often a few versions behind. Once you build experience with an older version of a gem, how do you get caught up?
A quick hint for all those that think that it comes by default with Errbit/Airbrake. Tracking Sidekiq workers exceptions with Errbit/Airbrake
When one Ruby method has to know the correct order of another method’s positional arguments, we end up with connascence of position. Ruby 2 Keyword Arguments help us reduce connascence, but there are some edge cases to be aware of.