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.
worldlite v0.1 - public domain country data (all data incl. as good ol' ruby code) - no db, no deps
Hello, I’ve put together a new world data gem, that is, worldlite, that includes all the world countries as good ol’ ruby code - no database required, no dependency, and all code and data is public domain, that is, no copyright and no rights reserverd. Try it. Use require 'worldlite'; include WorldLite and
>> WORLD.size # => 245
>> WORLD_UN.size # => 193
>> WORLD_G20.size # => 20
and so on. For countries try:
>> AT.class.name # => WorldLite::Country
>> AT.name # => Austria
>> AT.alpha3 # => AUT
Still early and rough but all the world’s countries and territories (246 total) included. Cheers.
‘Learn Ruby on Rails’ Free for Students
Do you know someone who teaches a class or workshop on Rails? I offer my book for beginners, Learn Ruby on Rails, to students enrolled in classes or workshops. See my blog post for details: ‘Learn Ruby on Rails’ Free for Students.
Reform 1.1 Brings More Reusability!
The 1.1 release of Reform brings better reusability for DRY form objects, simplifies and fixes lots of things and allows deserializing JSON and more, to make forms part of your HTTP API, too.
I just posted a write-up of using Active...
I just posted a write-up of using ActiveRecord’s .pluck if you only need a subset of model attributes. Check it.
Validating email address with domain correctness
Wanna a complete, quick and easy way to validate email address? It validates not only the format, but also domain address. You can check it here .
Rails i18n: 3 quick tips and 1 crazy abuse
Rails’ i18n library is more powerful than it looks. You don’t need to only use it for translation. The i18n library is useful anywhere you want to decouple the text you display from the place you display it. I’m going to share a few of the things that we learned that have come in handy, along with a crazy abuse of the library that ended up working out incredibly well for us.
Redirecting to Custom 404 and 500 Pages in Rails
Rails bundles default 404 (file not found), 422 (unprocessable entity), and 500 (internal server error) pages into every newly generated application. While they get the job done, these pages are pretty bland, so in this post I’ll show you how to update them to suit the logic and design requirements of your application.
Renewed Life for STI with PostgreSQL JSON type
How to avoid creating additional columns for child classes using RoR 4 and PostgreSQL 9.3, with an example based on social media users data: Renewed Life for STI with PostgreSQL JSON type.
Easier Rails Console Debugging with Awesome Print
I use the Rails console repeatedly throughout the day, but peering into object data can be a bit difficult due to poor formatting. Fortunately, a great gem called Awesome Print can bring an end to the formatting blues. In this blog post I introduce Awesome Print, and show you how to integrate it into your Rails console.
Developing and testing a Rails applications with subdomains
Subdomains can be a tricky thing to work with. So, we thought we’d share some tips to develop and test Rails applications using them.
A Way to Organize POROs in Rails
So, now we came to a point where our app no longer fit to vanilla MVC and we want to extract a service layer. By “Service Layer” I mean a collection of Plain Old Ruby Objects, which hold pure business logic. [more inside]
Green Ruby News #80
I just posted http://greenruby.org/grn-080.html fresh with the week cool news for open minded rubyists.
Getting to know AWS Cloud Formations and building custom resources using the cfn-bridge gem
Using Cloud Formations at AWS is an incredible way of building repeatable infrastructure, learn more about how it works and get to know cfn-bridge as well, a gem that aims to fill in the gaps not covered by the Cloud Formation API yet.
Tired of writing configurations for your gem?
tl;dr Go to github.com/beatrichartz/configurations and get MyGem.configure do ... end configuration functionality (plus bonus). [more inside]
sportweb - Instant Open Sports Web Browser (Server) e.g. Use $ sportweb football.db
I’ve bundled up the sport.db.admin web app (- demo running on heroku -) into an easy-to-use command line tool, that is, sportweb for (local) use on your own machine. Let’s say you have an SQLite database - e.g. football.db - in your folder, than just type $ sportweb and that’s it - open your browser (e.g. use localhost:3000) and start browsing your local SQLite sports database. Cheers.
Get to Know a Gem: 'Main' Chapter 3
Final post on looking into the Gem Main check it out!
RailsApps Update for Devise 3.3
Devise default views now say “Log in” instead of “Sign in.” And the wording of error messages has changed. My blog post on the RailsApps Update for Devise 3.3 contains links for the details.
Release equatable v0.4.0
Released update to equatable to help implementing equality comparison in ruby objects.
Semaphore CI is now free for open source
Semaphore, a hosted CI & deployment service is now free to use fo open source projects. There are also accounts for open source organizations, coupled with public profiles to show off your work. :)
The Vibe: Magic Mushrooms, Microservices vs Monoliths,What Ruined Rails and more.
This week/s I have been mostly programming Ruby and Go, occasionally thinking about monoliths and services. My general feeling at the moment on rearchitecting your app is nope. Push it out as far as you can and take steps to postpone the inevitable (in Rails land, that’s engines, components and gems). Feel the Vibe
Rails Misapprehensions: Replace Helpers With View Models!
The new Cells view model allows replacing helpers and partials with a clean, encapsulated component by introducing a badly needed new abstraction layer.
Useful FactoryGirl methods
I did this brief post about some methods and configs in FactoryGirl that are very useful. Check it out: some groovy thing.
kibana-rack 0.1.4 released
I just released version 0.1.4 of kibana-rack! This release has a set of fixes and refinements to the Elasticsearch proxy, thanks to @dcarley. Notably, proxying to the internal Kibana index is now working. [more inside]
Kaminari-Cells Is Ready!
The new kaminari-cells gem allows using kaminari’s pagination in cells.
Keep FactoryGirl's factories integral
Identify a problem when you have inconsistent test environment with FactoryGirl and solve the issue in this post.