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.
Hash Comparison in Ruby 2.3
Speaking of Ruby 2.3, I wrote about the new Hash comparison methods which we merged into MRI trunk just a day ago. They should make comparing hashes much easier. You can try them out in 2.3.0-preview1.
Ruby 2.3.0-preview1 released
The first preview for Ruby 2.3.0 which should come out later this year was released today, installation instructions are available in this Gist to build it from source or via rbenv & ruby-build.
Faster development mode in Rails 5
Rails 5 is getting a speed boost in development mode for larger codebases thanks to the initial work done by Puneet Agarwal in one of the 8 GSoC projects for the rails framework. Read about it here: http://weblog.rubyonrails.org/2015/11/11/snappier-development-mode-in-rails-5
Using Kaminari to paginate non-ActiveRecord query
Have you ever worked with SQL queries without ActiveRecord in a Rails app? In the post I review how to paginate raw query results with Kaminari. http://blog.iempire.ru/2015/11/08/kaminari-custom-query/
Redefining a Private Method in Ruby
What are the different ways to Redefining a Private Method in Ruby? Read it here
A component based Rails architecture primer
Component based architecture is complementary to good object oriented practices and uses namespaces, test driven development and Ruby gems to gradually define application boundaries and enforce an internal dependency structure. http://teotti.com/component-based-rails-architecture-primer/
Ruby DelegateClass
There are many ways to work with Ruby Objects. Inheritance, module inheritance, decorators, and composition are all commonly found in a codebase. The Single Table Inheritance pattern is a common pattern in Rails applications to share responsibilities between classes and store all records in the same place. This approach can work just fine, but it might be beneficial to think outside the single table for a second.
Using splats to build up and tear apart arrays in Ruby
The humble splat operator (*
) is one of those features of Ruby that just gets more interesting the more you look at it. In this post we’ll talk about how you can construct and manipulate arrays with splats. http://blog.honeybadger.io/ruby-splat-array-manipulation-destructuring/
Hack like a journalist
This week I presented a talk, “Hack like a journalist”, at the monthly meeting of LRUG (the London Ruby User Group). Based on my career experience working as both a software developer and in an editorial capacity, it takes a look at how one technique used by news writers – the ‘inverted pyramid’ – applies in the world of newspapers, and how the same principles can work in Ruby, to produce code that is readable and maintainable. [more inside]
Methods To Remember Things By: Ruby Memoization
No Rubyist wants to make expensive, time-consuming method calls more than they have to. Thankfully, using memoization means that we don’t have to (well, at least, not as often). This blog post covers the history behind memoization, its implementation, and its controversial history in the Rails source code.
Heroku and Passenger: focus on the app-performance
By running Passenger on Heroku, you will be able to tune your app for optimal performance at the lowest cost. With our full set of tools: Passenger, Passenger Status Service and Union Station we deliver a complete solution for running, monitoring and optimizing your application: https://blog.phusion.nl/2015/11/10/heroku-and-passenger-focus-on-the-app-performance/
HandlerSocket and Ruby
A short article about using a HandlerSocket plugin for MySQL with Ruby
Video: Processing Data with Kiba ETL (includes a live coding session)
In my latest post, I’m presenting the data-processing Kiba ETL gem in detail, underlining the business value of data processing, and also doing a live-coding session on a simple example.
Cut down on error messages by using Rails Routing Constr
Cut down on error messages produced by bots on your Rails app by using Routing Constraints. http://solidfoundationwebdev.com/blog/posts/restricting-action-formats-using-rails-routing-constraints
Build Your Own World Almanac in 50 Lines of Ruby (w/ the factbook Gem)
Hello, The lastest (and greatest) version of the factbook library - that is, v1.1.1 - now includes a new almanac class that lets you build your own world almanac e.g. listing all the world’s 260+ countries and territories with capitals, population, internet users, mobile telephone subscriptions/100, religions, ethnic groups, languages, and so on. See ALMANAC.md as an example. How to build your very own in three steps: [more inside]
Create a ecommerce page with rails backend in 16 min
This tutorial will walk you through to create really simple store page by using Get Shit Done Pro Rails Version gem. If you using Rails, you should definitely take a look at it as this gem will save you lot of time on rails frontend development. [more inside]
Ruby 2.2.3 Class Basics : Part 2
Ruby 2.2.3 Class method inherited hook allows you to find out who subclassed a given class. Watch the video
ActiveResource Basics using Rails 4.2.4
If you need to upgrade your Rails apps to 4.2.4, you need to know how to use the activeresource gem that is now outside the Rails framework. In ActiveResource Basics using Rails 4.2.4 article, I cover the basics of getting a simple book application to talk to an inventory application using activeresource gem.
Ruby 2.2.3 Module Basics : Part 9
Ruby 2.2.3 Module methods such as module_function, prepended, private_instance_methods, remove_method and undef_method is covered in this video
Rails : Render templates outside controllers
Came across this blog post where it discusses and compares ways to test or render the #view #templates outside of the #controllers. #rails5 #rails4 [more inside]
Reengineer legacy Rails applications
I wrote a blog post with a workflow to reengineer legacy Rails applications #rails #cbra #ruby http://teotti.com/reengineer-legacy-rails-applications/
How to Write Ruby Web Apps without Rails
We rubyists love our frameworks, and for good reason. But have you ever had a small app where Rails or even Sinatra was more than you needed. Even if you haven’t, every ruby coder should understand how a basic Rack app works.
Static Site Spotlight #1 - The Riding Rails Blog is build with ... Jekyll
Hello, over at Vienna.html I’ve started a new series that highlights a static site (w/ source) every week. The first real-world example is “The Riding Rails Blog” build with… Jekyll. The next example is “The Go Cookbook” build with… Jekyll. For more updates follow along. Cheers. PS: Know a great static site to spotlight? Let us know here or ping @viennahtml.
Ruby 2.2.3 Module Basics : Part 8
Ruby 2.2.3 Module methods such as extend_object, extended, included, method_added, remove_method and method_removed is covered in this video