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.
[Screencast] Bootstrap Framework and Ruby on Rails
Using Bootstrap in your application has become much more simple. Also learn to create some helper methods to make working with Bootstrap much easier. https://www.driftingruby.com/episodes/bootstrap-framework-and-ruby-on-rails
Why you shouldn't use the System Ruby
Your *nix computer will ship with a version of Ruby, and this seems great, you can get up and going right away and writing code. Things though are not all as they seem, you shouldn’t use that Ruby.
5 Pry Features Every Ruby Developer Should Know
Pry is a great resource for debugging and exploring code: Read more
[S]OLID - Single Responsibility Principle by example
Example of refactoring by following Single Responsibility Principle:
Added new JSON Feed (@jsonfeed) format to the (universal) feedparser gem
Hello, I’ve added support for reading feeds in the new JSON Feed format in - surprise, surprise - JSON to the universal feedparser gem. Nothing changes if you read in feeds in xml or json ;-) Use it like: Read more
The Ruby Module Builder Pattern
Did you know that Ruby has configurable modules? Just subclass the Module class, dynamically define some methods in an initializer, and include an instance of the resulting module in another class. I call this thing a “Module Builder” and I just wrote a long blog post explaining what it’s all about. Ruby’s had this secret up its sleeve for all these years, and most of us never knew about it.
Tip: Add JSON Feed (@jsonfeed) to your Jekyll (static) website / blog
Hello, A Quick Jekyll (Static) Website Tip: Add JSON Feed to your site. Step 1: Copy the feed.json template file. That’s it ;-) Source: vienna-rb/new-blog/feed.json Live: feed.json – Learn more about JSON Feed in Parker Moore’s posting titled “Add JSON Feed to your Jekyll site”. Happy publishing with Jekyll n friends. Cheers.
Red Arrow: Apache Arrow for Ruby
Ruby gets soon the data interoperability based on Apache Arrow. Read more
What if we organized code by features?
Digging through lots of code to figure out how a feature worked frustrated me on a large Rails project. I wrote about how I asked myself this question and what I did about it at
CanCanCan 2.0 is out!
After few months CanCanCan has finally a new major version: 2.0. There are many important changes in the new version but very few new features. We thought it was time to bring the project back on track and drop support for a lot of unnecessary features. Read more
Podcast: Michael Feathers on Avoiding Legacy Code
What makes a code base go bad and become “Legacy Code”? Can teams avoid writing bad code? Michael Feathers, author of Working Effectively With Legacy Code joins Tech Done Right to talk about technical debt, how communication can prevent bad coding practices, why coding problems are never just about code, and what it’s like to go around the world seeing the worst code messes ever written. Read more
Fighting the Hydra of N+1 queries
A huge insight into the problem of N+1 queries with Rails: starting from the junior-level stuff (what is it and how to fight it) moving to the usage of bullet gem, hardcore problems caused by the complexity of the application and DRY/OO patterns used — and ramblings on how to tackle the problem at its root. Read more
Building tools and building teams
I finished up my series about building tools to remove distractions with (with links to the previous 4 articles at the top if you missed them)
Testing Rails API with ActiveModelSerializers using RSpec
Thanks to this installment you can learn how you should test your API and how to write clean and readable tests using RSpec.
Setup your Ruby on Rails Server with Ansible
Go from development to production for your Rails app with Ansible. Come and watch how you can get your Rails app into production on your own server in about half an hour.
Ruby vs Python, the Scripting Wizards
Ruby vs Python, the Scripting Wizards
Template Rendering in Rails
Hi, I just made a slide to introduce how Rails renders our view templates and want to share with you. If there’s any problem or feedback please just email me :-) Read more
[Screencast] Routing Partials
The routes file can grow to be unmaintainable and messy. Learn to keep things organized by extracting out blocks of routes into their own files. https://www.driftingruby.com/episodes/routing-partials
Do analytical research using Ruby
The example of how you can use twitter-gem made by Erik. How to use Twitter Search API and what you can do with it? Read more
Testing a Feature with Rails and RSpec: A deep dive
One of the things I hear most from developers who are new to Ruby and Rails, or just to testing is, How do you get started? What should I test? The value of testing your code and the confidence it brings is already apparent, but how to make it happen seems to be missing. In this post I address how I approach testing a fairly simple, but non trivial feature from start to finish.
Ruby/Rails Interview Questions
Pre-compiled list of questions with regard to Ruby and Rails for interview candidates. Contribution is more than welcome.
Density Map in three ways
Detailed article explaining different solutions to the same problem, each with different time complexity. From O(n^4) to O(n^2).