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.
Implementing the Bit Array Data Structure in Ruby
In this article, I will explore how to implement the Bit Array data structure in Ruby, and compare its performance to the implementation in the bitarray gem, which uses a more efficient, but slightly more complex implementation. Continue reading…
Phoenix vs Rails: Views and helpers
Here’s an overview, case study and comparison to Phoenix of the V part of Rails MVC as experienced across the years. Read more on the Phoenix on Rails blog.
active_record_doctor 1.2.0 released
active_record_doctor helps you to identify database issues before they hit production. Version 1.2.0 can index foreign keys lacking an index and detect extraneous indexes (e.g. ones that can be replaced by a multi-column index) and take unique constraints into account.
How I Went Crazy With Solr and Sped up Rendering 1588x
Roll your own partial caching on Rails with Sunspot and Solr. Easy to do and stupid fast. Plus, fun to try out something a little different and watch it succeed spectacularly. [more inside]
How to use protected_attributes in Rails 5
Did you know that the only thing stopping you from using protected_attributes in Rails 5 is the gem dependencies and a small patch to ActiveRecord::Core. The rails repo of protected_attributes is not longer supported and issues and PR’s are denied. I have created the continuation of that gem protected_attributes_continued which supports Rails 5! https://github.com/westonganger/protected_attributes_continued
Recurring Events in Rails
In this article, I explore one one of the ways to model weekly recurring events in a Rails application. We will build a system where your users can set up a weekly recurring reminder (eg. “send status reports at 5pm on Fridays”). Continue reading…
API authentication using Devise and Doorkeeper (minimal setup)
Have you ever tried to setup Devise and Doorkeeper in the simplest possible way, without oauth applications etc? Here’s my new blog post about this!
Journey of a Trailblazer - Refactoring a real Rails app with Trailblazer
A blog post about refactoring a Rails application with the Trailblazer architecture. [more inside]
Rails 5 trims session storage by discarding some flash messages
Rails 5 trims down session storage by removing discarded flash messages before persisting into the session. [more inside]
The Pure Function As An Object Pattern
In this article, I want to demonstrate a nice way to write functional-style code in Ruby. It is a way to write non-trivial pure functions, without a bunch of weird non-idiomatic code.
What kind of tests should I write for my project?
Should I test my project? Should I write dozens of tests for each feature? What kind of tests should I focus on? Not all projects are created equal - testing is the same. Sometimes you need to test hard, sometimes you don’t. I’m sharing a few observations on testing from my 16 yrs experience as a software developer. Test fundamentalists do not open ;-)
A Rails todo-list simple project
Login and account creation,Ajax(Drag & Drop to-do items),CSS,Nice templates/layouts. heroku https://pure-bayou-75590.herokuapp.com/ , github https://github.com/arnkorty/rails-todolist . test account email: test@test.com password: 123456
Scheduling Recurring Events with Ice Cube Gem
Ice_cube is a ruby library for effectively taking care of repeated events (schedules). The force lies in the ability to indicate multiple rules, and have ice_cube rapidly make sense of whether the schedule falls on a specific date (.occurs_on?), or what times it… read more
5 easy steps to use Refinery CMS and Spree e-commerce on the same Ruby on Rails app
In this guide we will learn how to: Generate the Ruby on Rails application, Install Spree 3.1.0, Install Refinery CMS 3.0.0, Mount Spree before Refinery, Enjoy your new Spree-Refinery app: 5 easy steps to use Refinery CMS and Spree e-commerce on the same Ruby on Rails application
Use Sunspot Stored Attributes to Search and Store Calculated Attributes on Rails
Read the following to see how to use Sunspot and solr to search calculated fields on your Rails models and give a drastic speed boost to your application. [more inside]
Avoid using exceptions for flow control
Why it’s a bad idea to use exception for flow control, and a short example based on devise’s code showing an alternative approach. http://jaszczurowski.com/avoid-using-exceptions-for-flow-control/
English Premier League (EPL) 2016/17 Season - Open Data in Text (n SQL, JSON,...)
Hello, I’ve added the new 2016/17 season for the English
Premier League (EPL). To import the plain text public domain datasets (fixtures) in your (SQL) database of choice (defaults to sqlite) use $ sportdb build in the /eng-england folder. It’s that easy ;-) Enjoy the beautiful game. Cheers. PS: Step 0.1 - $ gem install sportdb and Step 0.2 - $ git clone <https://github.com/openfootball/eng-england.git> or download the zip archive. PPS: Find out more about the sportdb gem family on the project site.
Sinatra Two Point Oh!
Today, I’m pleased to announce that Sinatra 2.0 has it’s first pre-release! Read the full post
[Screencast] Antivirus Uploads with Clamby
Using ClamAV, scan files uploaded to your application for viruses. In the event of a virus learn how to gracefully handle the infected file and notify the user. https://www.driftingruby.com/episodes/antivirus-uploads-with-clamby
Creating staging and other environments in Rails
Changes are you might need at some point staging, profiling, migration or other environments for your app. This post will tell you the 4 things to keep in mind when adding them.
How to Setup Solr Search on Rails with Sunspot
Solr’s an excellent search solution and a powerful tool to use for production rails app. It scales and can expand beyond searches on saved model attributes as well. [more inside]
meet zchannel.rb
zchannel provides a high level and easy to use API for sending objects between Ruby processes.
Basic design patterns in Ruby on Rails
I’ve chosen two design patterns I found the most common in Rails world and described them: http://naturaily.com/blog/post/basic-design-patterns-in-ruby-on-rails
Rubinius takes the fun out of Ruby
A great read by Brian Shirai on how objects should be used for interactions and… functions should be used for data. [more inside]
The Ruby Community and Reputation
There’s been a lot of ranting recently. I’ve posted about in my “Elephant in the Room” post a few months ago, this is my conclusion and possibly last post about this subject.