RubyFlow The Ruby and Rails community linklog

×

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

You can use basic HTML markup (e.g. <a>) or Markdown.
Note that your post may be edited to suit the format of the site.

As you are not logged in, you will be
directed via GitHub to signup or sign in

Post Preview

Note: Only the first pargraph is shown on the front page and overly long paragraphs may be broken up.

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.

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]

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.

Metaprogramming Dynamic Methods: Using Public_send

Metaprogramming is super cool, but it’s also super tough to learn when you’re first starting out. This blog post takes a look at metaprogramming through dynamic method calls, and explains and implements the public_send method in a real-life example of code abstraction.

Guess most people only know send but not public_send since send is used more o…
Loading older posts