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.
How to change source for Active Model?
The nice thing about Active Record scopes is that you not only can specify where conditions. I recently had a need to run a query against a model to discover previous and next elements. This can be easily achieved using window functions. The trick was to change Active Model to use the query instead of the table.
Use of Gon with Javascript & Rails
Using Rails data as a part of javascript is an extremely regular need, particularly for Javascript applications such as Angular, Ember and SPA. Here’s how you can do that.Use of Gon with Javascript & Rails
Rubycoders.io new landing page !
I have just relased a new landing page for Rubycoders.io please give me a feedback! Thanks!
Running Sinatra in the Pakyow Environment
Pakyow’s new Runtime Environment lets you mount multiple endpoints in a single process. It supports any Rack-compatible endpoint, which made me wonder if it would be possible to run a Sinatra app within the Pakyow Environment. I recorded a screencast with what I found »
A Rubyist's Guide to Big-O Notation
Big-O notation gives you crucial insight into why your apps aren’t as fast as you’d like them to be. In this post we’ll uncover the meaning of things like O(N^2) and show how to use these concepts to speed up your apps and your database queries. - http://blog.honeybadger.io/a-rubyist-s-guide-to-big-o-notation/
Gemsmith 8.0.0
Happy to announce a major version release of Gemsmith. This is a powerful tool for building professional-grade Ruby Gems with an emphasis on modern design, security, and high code quality standards. Also supports publishing to RubyGems or private gem servers. For further details, check out the v8.0.0 Changes.
[Screencast] Getting Started - Ruby on Rails - Development Environment
Here is a simple workflow of setting up a new development environment. From Homebrew, ZSH, Atom, and RVM, learn how to easily get your macOS environment up and running. https://www.driftingruby.com/episodes/getting-started-ruby-on-rails-development-environment
Thredded v0.8
Thredded, the best Rails forums engine, has just released v0.8.2. This is a major release that adds these major improvements: [more inside]
Your first Progressive Web App on Rails
New JavaScript APIs are making it possible to deliver mobile app-like experiences on the open web—think: offline access, background sync, push notifications. “Progressive Web App” technology is still very young, but has a lot of promise and it’s time Rails community took notice. In this post, we’ll demonstrate how to turn your Rails app into a Progressive Web App using the serviceworker-rails gem.
Testing Rake Tasks with RSpec Feature Specs
There’s nothing worse than getting into the office, only to find out that one of your nightly rake tasks threw an error and didn’t complete. You get to a point where testing all the pieces in isolation just isn’t good enough. It’s time to be confident that all of the pieces will work together. Time to start testing your Rake tasks with RSpec feature specs
RailsApps Examples for Rails 5.0
I currently maintain eleven RailsApps example applications on GitHub that developers use as starter applications. Each can be generated with the Rails Composer. I’ve recently updated Rails Composer and the example applications for Rails 5.0. Details in a blog post, RailsApps Examples for Rails 5.0.
Flexible, ORM-agnostic, fully customizable and simple OAuth2 provider for Grape API
GrapeOAuth2 gem adds a flexible OAuth2 (RFC 6749) server authentication and endpoints protection to Grape API projects with any ORM/ODM/PORO. It is extremely customizable and configurable and can be used with any ORM/ODM or even Plain Old Ruby objects.
Fix known vulnerabilities with Snyk and GitHub
Snyk announced support for finding and fixing known security vulnerabilities in Ruby applications with automated pull requests. Free for open-source projects.
x == x = WTF?!
New post (finally!) on Attack of the Codosaurus, about what happens when you do some very strange Ruby code:
Protecting from XSS with Sanitize
Learn how to protect from XSS attacks with sanitize including sanitizing your link_to calls.
On Structuring Rails Applications
There is a long going discussion on fat-this and skinny-that when building software systems. Obviously, you want to avoid fat classes all over, but where do you put the code then? In this two-part blog post, we explore the layers provided by Rails and look out for new places to divide our code further.
GeoSpatial Search in Rails Using Elasticsearch
Find how to use Elasticsearch and Geo Spatial search in your rails application.
Ruby 2.4.0.preview3 Binding#irb
Ruby 2.4.0.preview3 new method to debug is Binding#irb. It’s a short article about it.
Microservice Communication with Queues
A microservice that is never used is useless. Ready Leigh Halliday’s article on Microservice Communication with Queues.
Code Analysis: Minitest
An interesting code exploration session even if you are not a regular Minitest user :)
Code Refactoring Gem – Flay
Keeping your code elegant and no code clones while building up a vast Rails application can be a significant test, notwithstanding for an accomplished developer. Fortunately, there is a gem that make this code refactoring much simpler. Code Refactoring Gem – Flay
A brief look at RSpec's formatting options
How I used RSpec to find weird output polluting the logs and our test suite:
Nested Objects With Strong Parameters In Rails
This article shows how to permit nested objects in your json requests.