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.
[Screencast] Setting up your Rails API
Starting a rails API from scratch using interesting and important gems. [more inside]
[Screencast] Counter Cache Associations
When displaying a count of records, this will generate extra SQL Queries. Learn how to reduce the number of SQL queries called with counter caching the number of associated records. https://www.driftingruby.com/episodes/counter-cache-associations
InvoicePrinter 1.0.0.rc1 released
InvoicePrinter, gem for super simple invoicing in Ruby, is very close to the first stable version with a fresh rc1 release. API is now stable. Please let me know if something is broken for you, thanks!
Result Objects - Errors Without Exceptions
This article covers some of the problems with exceptions, and introduces a functional, alternative approach to error handling.
Idiomatic Ruby: writing beautiful code
An article based on Ruby best practices and idiomatic code: https://medium.com/the-renaissance-developer/idiomatic-ruby-1b5fa1445098
Automating Favicon Generation in Rails using Sketch
A brief tutorial on using sketch, rails, rake and imagemagick to simplify generate a favicon. https://ksylvest.com/posts/2017-04-29/automating-favicon-generation-in-rails-using-sketch
Released version 0.1.0 of timeliness-i18n gem!
Hey guys! I created recently a gem called “timeliness-i18n”, that contains all translations used by gem timeliness (https://github.com/adzap/timeliness). The URL for gem is: https://github.com/pedrofurtado/timeliness-i18n [more inside]
Advanced Text Layout is Coming to HexaPDF
HexaPDF will gain first traces of advanced text layout in the coming months and background information on why this is hard in PDF - https://hexapdf.gettalong.org/news/2017/advanced-text-layout-is-coming.html
Following Rails redirects with Capybara
This a very short note on setting up Capybara to correctly follow redirects with Rails classic redirect_to @object pattern.
Enter (amper)Sandman
A small overview of using the ampersand syntax for enumerable collections. We know that we can send methods to the object, and use local procs or lambda’s, but did you know you can use normal local methods too?
Protect the Data!
If you were to ask yourself - what is the essence of any software system - what would you say? There are several things I can think of, such as clean code, DRY methods, integration testing, the technology being used, great design… Still if I had to pick between losing all of those, or just the data and almost my answer would be: “Protect the data”. https://blog.kodius.io/2017/04/14/protect-the-data/
Machine Learning with Ruby
We’ve started a new awesome list for Machine Learning in Ruby. [more inside]
Service objects in Ruby with MethodObject
Lightweight and dependency-free solution for the creation of method objects: extract your complex methods from your models and move them into service objects. https://github.com/LIQIDTechnology/methodobject
3 Ways to Keep Your Ruby on Rails Apps Healthy
Introducing a few quick and simple ways you can help ensure your app’s code is secure, good quality code, and monitored in production.
Ruby on Rails Patterns – Decorator Vs. Presenter
http://www.bacancytechnology.com/blog/ruby-on-rails-patterns-decorator-vs-presenter
Bundler’s new update options
Let’s see how Bundler’s new command line flags allow you to be more conservative when updating gems.
Expressive tests with RSpec - part 1: Describe your tests properly
In this article we will have a look how to use describe, context and other RSpec features to write more descriptive tests [more inside]
How to make sure you deliver the product
My view on working on MVPs or tight deadlines. We don’t need to aim for a perfect solution from the beginning [more inside]
Full-Stack Testing with Rails System Tests
Rails 5.1 is on its way, and with it, developers will finally have access to Capybara-based system tests right out of the box. Users of Rails integration tests will receive a major upgrade in functionality, and those who already use Capybara are about to see their lives get a whole lot easier. This post looks at Rails’ approach to system tests and why this should be the thing to finally convince you to start testing your app end-to-end.
Creating a Sales Analytics App with Ruby on Rails: issue solving
This is about our - slightly - bumpy development road when creating a Sales Analytics App with Ruby on Rails. Read about some issues we encountered on our way and how we solved them: https://developer.epages.com/blog/2017/04/18/creating-a-sales-analytics-app-with-ruby-on-rails-2.html
Search by radius in Redis
How to retrieve geospatial items near a specified point using Redis: http://blog.primehammer.com/2017/04/25/search-by-radius-in-redis/
Implement Devise + Omniauth2.0
Do you want to implement Devise + Omniauth2.0? Know about real working project implementing these. http://mayurkumar.info/blog/how_to_use_devise_with_omniauth/
Stop Using Case Statements in Ruby
Learn how to use polymorphism to write better Ruby code & avoid conditionals: http://www.blackbytes.info/2017/04/stop-using-case-statements-in-ruby/
Rails API with Active Model Serializers
In this tutorial we show how to build an API, which helps to organize the workflow of a library, using Rails API 5 with ActiveModelSerializers. https://www.nopio.com/blog/rails-api-active-model-serializers/
Generate automatically unique usernames in Ruby on Rails
How to generate unique usernames in Ruby on Rails without user intervention [more inside]