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.
Tackle complex Rails applications with component based architecture
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.
Chaining an Array into Arel ors
Dynamically build Arel OR queries from an Array.
Ruby Object Model Basics
The current object, ‘self’ in Ruby: Ruby Object Model : The Current Object, ‘self’ in Ruby
Idiosyncratic Ruby: Episode 5-8
The last days on @idiosyncraticrb: Exploring the mysterious script lines constant, standard library’s un.rb, the ruby -s command-line option and an opinion about module_function vs extend self!
Documenting architecture decisions
Ever forget why you did something in your code? Here’s the solution.
Four Reasons Why Rails Rocks at Wolox!
Rails’ tools help our developers build our apps as fast as possible without sacrificing code quality. We can easily customize Rails to suit our product’s needs. Learn more about it: http://bit.ly/1dPzzbv Wolox GitHub: https://github.com/Wolox
Almost Sinatra in Six Lines of Ruby - A Breakdown - Build Your Own Microwebframework
FYI: A line-by-line breakdown of Konstantin Haase’s Sinatra refactored in six lines of Ruby from yesterday’s Vienna.rb talk. As an all-in-one-page version or as an online flip-through slide show. Get inspired and build your own microframework. The world needs more New York, New Yorks, Nancies, Rums, Cubas, etc. Cheers.
Embedded CSS in SVG can break your design
Some days ago I started to integrate mermaid – a JavaScript framework for diagrams and graphs – into middleman-presentation – a presentation builder framework based on reveal.js. But then I faced a rather strange design issue. Read this article for more on this topic.
Speed up ActiveRecord with a little tweaking
When you’re building a new Rails app, ActiveRecord’s defaults will take you far. Querying with .where, inserting with .save — it’s all so easy, and it’s fast enough. But when a page of mostly simple content takes a second or more to come back from the server, that’s when you know you’re going to have to spend some time on performance. Luckily, you don’t have to go too far from the simplicity of Rails to see drastic improvements in your app’s response time.
RocketConf 2015 Announced
RocketConf 2015 is a European conference for the modern web developer and dev ops. Located in Amsterdam, The Netherlands, this three day conference is guaranteed to blow your mind. See rocketconf.eu for info about speakers, venue and tickets.
Minitest::Benchmark: A Practical Example
The last post looked at Minitest::Benchmark as a high-level concept and sketched out a basic structure, so now we’re ready to take a first crack at a practical benchmarking example to see how we can apply that knowledge.
Speed up Rails app development with RailsBricks
Sitepoint’s tutorial on creating Rails apps using the RailsBricks app builder:
Mocking with RSpec
Mocking is a powerful TDD technique if used wisely. I wrote an article that explains mocking with RSpec, with examples. Hope you find it useful!
How Ruby gems work on the command line
Learn how the gems you use actually work on the command line. Good to know when you’re building your own.
How to store emoji in a Rails app with a MySQL database
MySQL’s utf8 character set allows to store only a subset of Unicode characters - only those characters that consist of one to three bytes. Inserting characters that require 4 bytes (e.g. emojis) would result in corrupted data in your database. Learn how to fix it with utf8mb4 charset.
Speed up Rails with Nginx’s Reverse Proxy Cache
Nginx is a great web server for Rails apps, but did you know it also has powerful caching abilities? To take advantage, you’ll need to set appropriate HTTP cache headers in your Rails app, and then turn on reverse proxy caching in Nginx. Here’s my tutorial.
Examples of Ruby Patterns
We’ve added the State Pattern in Ruby Patterns, hope you find it useful!
Building an Event Sourced application using rails_event_store
Still not sure what is Event Sourcing and CQRS? Looking for a practical example? You’ve decided to give Event Sourcing a try? No matter why let’s dive into building an Event Sourced application in Rails using rails_event_store gem. Read more
A week with a Rails Security Strategy
You’re a busy person. Security is not a very visible feature in most applications, and so sometimes it’s not a priority. Of course you know it’s important, but how can you fit it into your busy schedule? Here is how a week with a Rails security strategy for busy developers could look like.
Problems with nil and how to avoid them
New blog post: “Problems with nil and how to avoid them” by Karol Galanciak.
Extract a service object using SimpleDelegator
It’s now more than 1 year since I released the first beta release of the “Fearless Refactoring: Rails controllers” book. Many of the book readers were pointing to the one technique which was especially useful to them - extracting a service object using SimpleDelegator. This technique allows to extract controller actions into service objects within minutes, if not seconds. Read more
How to Start with Ruby?
I wrote a new article exploring How to Start with Ruby?. Hope you enjoy!