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.
All World Cups (1930-2018) - $ sportdb new worldcup ++ Datafile worldcup.rb Updated
Hello, Due to popular demand and to make it easier for everybody I’ve updated the worldcup.rb datafile to build the complete world cup history, that is, all world cups included from Uruguay 1930 to Russia 2018. Try: $ sportdb new worldcup to build yourself an up-to-date (local) SQL database from scratch (zero). Enjoy the beautiful game. Cheers. Prost. PS: You can find the ready-to-use ActiveRecord models (tables) e.g. Team, Player, Goal, Player, League, Season, Group, Standing, etc. in the sportdb-models gem / library.
How to create perfect enum in 5 steps
A quick “How to” on managing attributes’ values using ActiveRecord’s Enum: http://naturaily.com/blog/post/ruby-on-rails---how-to-create-perfect-enum-in-5-steps
How Not to Lose the Database Logic in Rails Application
This article offers a way to handle tasks that require updating certain data when some other data is changed in Rails applications.
How to add I18n.locale as a part of caching key automatically
with https://github.com/igorkasyanchuk/cache_with_locale you can use fragment caching automatically with I18n.locale. No more code like “cache [I18n.locale, user]”. DRY your code.
Resgen: Resume Generator
Keep track of jobs you’ve applied to, automate resume & cover letter creation; generate PDFs from .odt templates on the fly while scraping the job post and tracking employer status. https://github.com/angela-d/resgen/ [more inside]
Clean HTML tables
I’ve just released version 1.0.0 of dining-table, a gem that allows you to write clean ruby classes to generate HTML tables, instead of messing with views. You can re-use the same classes to generate csv and xlsx output, too!
Rails API + JWT + VueJS SPA
This article describes how to build CSRF/XSS secure VueJS client for API-first Rails application.
footty - football.db command line tool / client for world cup (russia 2018) update
Hello, I’ve updated the little command line tool / client called footty that lets you query the online football.db HTTP JSON API services for today’s and tomorrow’s matches for the football world cup in russia 2018 - the world’s biggest show (3+ billion fans). What’s news? footty now includes the full time scores and goal getters e.g. POR 3-3 ESP: Ronaldo 4’ (pen.) Ronaldo 44’ Ronaldo 88’; Costa 24’ Costa 55’ Nacho 58’. Enjoy the beautiful game with ruby. Match day 3 (in JSON) thanks to /world-cup.json. Argentina vs Iceland upcoming. Kick off in seven hours.
How to track user events and visits in Rails using Ahoy gem!
In the realm of Rails Ahoy is a gem which we can use for tracking various events and visits as we want. It has saved a lot of time and effort for us! [more inside]
How to Speed Up Your Tests via :build_stubbed
Learn how to speed up your test suite using build_stubbed. This approach works well when you test models or services. [more inside]
Rails API CSRF protection for SPA
How to secure Rails API for SPA with CSRF protection? Is it needed for JWT ? Or just for session cookies? In this article we will look at the problems and solutions :) [more inside]
Organizing Ruby on Rails recurring tasks with Whenever
In this post I show you how you can use Whenever gem to manage recurring tasks in your Rails app, and how to integrate it with Rbenv and Capistrano [more inside]
Build-Measure-Learn after GDPR
In his talk at the Amsterdam Ruby Meetup, Niels van der Zanden explores how any small business trying to sell a thing on the internet can still get a feel for who their customers are, without overstepping the legal boundaries of the new data protection regulation: https://blog.phusion.nl/2018/06/14/build-measure-learn-after-gdpr/
Spree 3.5 and 3.6 with Rails 5.2, Ruby 2.5 and ActiveStorage support released!
Spree is a complete, modular & API-driven open source ecommerce solution for Ruby on Rails. [more inside]
Using GraphQL with Rails
An introduction on how to design and consume APIs in Rails using GraphQL instead of REST. https://vitobotta.com/2018/06/13/using-graphql-with-rails/
Quick tips for practical Rubocop workflow
How to use Rubocop day by day for (code) sanity https://blog.dnsimple.com/2018/06/quick-tips-for-practical-rubocop-workflow/
Why Do We Create Classes?
Why do we use classes instead of having just one GIGANT blob of ugly code? https://www.rubyguides.com/2018/06/why-do-we-create-classes/
Semaphore Doubled Free CI/CD Capacity for Open Source
Semaphore has increased the free CI/CD capacity on all open source organizations from 2 to 4 Boxes: https://semaphoreci.com/blog/2018/06/13/doubled-free-cicd-capacity-for-open-source.html
How to Integrate Google Maps into Ruby on Rails App
In this post we will share with you a detailed tutorial on how to integrate Google Maps into Ruby on Rails App. [more inside]
Applications of Lambda in Ruby
Thoughts about lambda in Ruby by Eugene Komissarov, Backend Developer at JetRockets. http://jetrockets.pro/blog/lambda
Passenger 5.3.2 released: various security fixes
Passenger 5.3.2 was just released, fixing a file system access race condition [CVE-2018-12029] as well as various SpawningKit exploits [CVE-2018-12026 - 12027 - 12028]. We urge you to upgrade your version immediately. The release notes contain more information on the measures we’ve taken to recognize security flaws quicker in the future: https://blog.phusion.nl/2018/06/12/passenger-5-3-2-various-security-fixes/
Telegram::Bot 0.14.0 released
https://github.com/telegram-bot-rb/telegram-bot/wiki/v0.14-announcement This update resolves some issues that had to be addressed before first major release. It brings breaking changes trying to make bots more secure and their source-code more consistent, while keeping it clean and simple - this is what we like Ruby for.
How to rename an ActiveRecord model
In this post, we will work on a step by step process to rename an ActiveRecord model. [more inside]