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.
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: http://www.sitepoint.com/railsbricks-start-faster-rails/
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. https://tomdebruijn.com/posts/gems-on-the-command-line/
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!
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. http://blog.ragnarson.com/2015/05/06/problems-with-nil.html
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. [more inside]
How to Start with Ruby?
I wrote a new article exploring How to Start with Ruby?. Hope you enjoy!
Ruby hash initializing – why do you think you have a hash, but you have an array
We all use hashes and it seems, that there’s nothing special about them. They are as dictionaries in Python, or any other similar structures available for multiple different languages. And that’s more or less true. Although Ruby hashes are really special, because from time to time they really are… arrays. You can read more about that here.
A Simple Way To Increase The Performance Of Your Rails App
There are many way to increase the performance and code your rails application , it is a vast topic and subjective to the application your are development will be discussing small changes that can be done, which will change performance and improve it.
Separating Abilities in CanCan
In this post Separating Abilities in CanCan, Jordan has a look at an example Ability file and enumerates some flaws in such a system. Following that he discusses a way to improve it by breaking the Ability file out into multiple Ability files.
Object hierarchies in Ruby
In this article I go over the basics of the Ruby object ancestor chain and also cover the default parent objects: Object, Kernel, and BasicObject.
How much testing is too much?
It’s painful to work with badly tested code. But when you just wrote what seems like 200 tests to ship one tiny feature, those days before you knew about testing and TDD seem better and better. There must be a middle ground. So how much testing is the right amount?