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.
Lifetime Ruby on Rails Mentorship giveaway
Hey! Just wanted to share this exciting Christmas giveaway of Lifetime access to Rails mentorship. 4 days left to join so hurry up :D
Hash19: A Ruby gem to map complex JSON to objects
I just wrote a JSON aggregation library that I thought would be a fairly common use-case. A write up on that is available here
Testing logging in Ruby with StringIO and a few lines of code
Testing logging in Ruby with StringIO
Opal under a microscope: Object creation in Ruby and JavaScript
In this post we’ll learn how Ruby objects are mapped in JavaScript-land by the Opal compiler, how to call methods on them and how object instantiation works for both Ruby and JavaScript.
Video Tutorial: Deploy Ruby on Rails To Your Own Server
Learn how to Deploy Ruby on Rails To Your Own Server with this video tutorial series using Ubuntu, Postgres, Nginx, and Unicorn.
Repository Driven Infrastructure
Repository Driven Infrastructure helps managing your infrastructure from your repository. Developers describe their intent to deploy, the system picks it up and follows through on it. Read more
Rails Fundamentals: Introducing Strong Parameters
One of Rails’ most visible historical protections against malicious data corruption involved using the attr_accessible method within a model to identify which model attributes could be passed into methods like new and update_attributes for mass assignment. This changed with Rails 4, thanks to a new approach for managing mass assignment behavior. Known as strong parameters, the task of defining which parameters are available for mass assignment has been moved out of the model and into the controllers, allowing developers to define mass assignment behavior according to action. In this tutorial, I’ll introduce you to strong parameters, and include several usage examples.
search_cop v1.0.3 released
I just released v1.0.3 of search_cop which brings support for Rails 4.2. Happy searching.
Elegant permalinks in Rails
Small guide about adding elegant permalinks to your Rails app using the friendly_id gem.
You lose context when using an API
Just blogged about the difference between server side HTML rendering and the use of an API. Read more
Hashie Considered Harmful - An Ode to Hash and OpenStruct
Have you ever used Hashie? You may (not) be surprised that it’s a horrible idea. But you may interested to learn hashie is responsible for a 5% decrease in all app speed if you’re using omniauth. To learn more about why having an object that inherits from hash and acts like an object, read hashie considered harmful
A Ruby Refactor: Exploring Dependency Injection Options
I wrote a new post titled A Ruby Refactor: Exploring Dependency Injection Options. Hope you enjoy!
First impression about ROM (Ruby Object Mapper)
Here I listed my experience with DataMapper 2 which wasn’t released and ROM (inheritor of DataMapper 2). We already started using it and I guess our experience may be interesting for other developers as well.
Keep method_missing and respond_to_missing? in sync with hook_lying_syncer!
One of the big gotchas of Ruby metaprogramming is the need to keep method_missing and respond_to_missing? in sync. I’ve just published the hook_lying_syncer gem (code on Github) to help with this. See the README on Github for details.
Where Does Your Code Go?
After you finish the Rails tutorials and start your own app, things get confusing. Like where does your non-CRUD, general logic go? How does grabbing followers from Twitter fit into MVC? Ask two people, and you get four answers. So where do you put your code, and still keep things simple?
Preferring Value Objects Or Setters And Arguments
I recently wrote a post where I show some code displaying the contrast between using value objects and setter methods.
Baruco meets FutureJS: Announcing Full Stack Fest 2015!
After the continued success of three editions of Baruco and one of FutureJS, we are already working on a new twist for 2015, and we are proud to announce it today: Full Stack Fest.
Opinionated guide to service objects
I just decided to write a blog post about Service Objects, which is a pretty controversial topic these days. Hope there will be a lot of comments and stormy discussion :)
Planet Pluto Update v1.1.0 / Modul-mania - pluto-models, pluto-update, pluto-tasks, etc.
I’ve uploaded a new pluto version, that is, v1.1.0. What’s pluto? A free planet site generator for building web pages from published web feeds e.g. Planet Ruby, Planet JavaScript, etc.
What’s news? The pluto gem is now split up into five gems. The lineup includes: pluto, pluto-models, pluto-update, pluto-merge, pluto-tasks The idea is to make it easier to use what you need and make it easier to change to your needs. All planet temlates (e.g. hacker, news, digest, etc.) moved to its own GitHub org, that is, planet-templates and you can now install planet templates w/ npm too e.g. $ npm install planet-top. Happy planet. Cheers.
Production Rails Deployment with Nginx and Unicorn
Our new tutorial talks about how to set up production Rails deployment with Nginx and Unicorn. Read more
-to cardinal gem- made for learn about ruby
I just launched ToCardinal gem and I really would like that you give me some feedback to improve it. I have two purposes, contribute to community and learn about this. So I’ll appreciate your comments.
Capability Reporting with Service Worker
Some people, when confronted with a problem, think: “I know, I’ll use UA/device detection!” Now they have two problems… Service Worker solves this problem: instead of guessing on the server, we can (finally) teach the client to report the necessary values!
Charts for your rails models with MetricsGraphics.js and NVD3
models_stats gem - it’s graphics for your rails models with MetricsGraphics.js and NVD3. It may show count(or average, or sum, or another sql agregate function) of models for each day with grouping, conditions. It uses Redis for store statistics.
Necromancer v0.3.0 release
New necromancer includes more array conversions and ability to configure global options such as strict mode.
Get insights of your PostgreSQL database with PgHero
PgHero is a ruby gem that gives you insights of your PostgreSQL database: cache hit rate, which queries are too slow, which tables need indexes, and more. Here’s how it looks on a production RoR app.