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.
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. https://rossta.net/blog/make-your-rails-app-a-progressive-web-app.html
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: http://blog.codosaur.us/2016/11/x-x-wtf.html
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. https://code.tutsplus.com/tutorials/geospatial-search-in-rails-using-elasticsearch--cms-22921
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. http://enderahmetyurt.com/2016/ruby2-4-binding-irb/
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 :) http://www.blackbytes.info/2016/11/code-analysis-minitest/
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: http://www.ombulabs.com/blog/rspec/ruby/using-rspecs-documentation-format.html
Nested Objects With Strong Parameters In Rails
This article shows how to permit nested objects in your json requests. https://solidfoundationwebdev.com/blog/posts/nested-objects-with-strong-parameters-in-rails
(Keep On) WebMockin' in the Real World
The previous post in this series introduced WebMock with a simple example application and showed the basics of how to use it to stub external API calls in your code. But real distributed applications aren’t always so simple. This post shows practical techniques for tuning your stubs and handling edge cases to get the most out of the tool and test your code more thoroughly.
How to set a default queue name for all jobs in Rails?
I’m working on a gem for sharing common Rails code between my apps. I just added there a first job and hit a problem - the job from the gem was using default
queue which doesn’t exist. Here’s how I changed all jobs to use a specific queue without using queue_as
or extending ApplicationJob
.
Preparing Clean and Customized JSON response for Rails API
To know about best practices on overriding as_json and to_json of object to prepare proper json responses, read my post on parthtalks Blog Post or on Medium at Medium article link. I will be writing about advanced rendering with active model serializers in next article. For more posts visit my blog at http://parthtalks.weebly.com and let me know about what you think about my articles.
Go Full Stack Rails - The Frontent part 1
This is part 3 of a series of blog posts where I walk the reader through building a real full-stack application with Rails and ES6, from beginning to end. “The Backend” part 1 and part 2 are also available online. [more inside]
Monitor processes memory in your browser
instrumentation
is a Ruby gem that lets you monitor any process memory usage and visualize it on your browser. It looks like this: [more inside]
Awesome Jekyll - Add Your Articles, Guides, Tips & Tricks, Goodies ‘n’ More
Hello, Just a reminder: I’ve started an awesome collection about - surprise, surprise - all things Jekyll. Find the list @ /planetjekyll/awesome-jekyll
on GitHub. Anything missing? Articles Guides, Tips & Tricks, Tools, ‘n’ more. Your contributions more than welcome. Cheers.
Telegram::Bot 0.9 is out
Integrate Telegram bot into your Rails app or build standalone one.
Now your bots will be more stable, because you can write tests faster with built-in rspec matchers. And don’t worry about network errors: with async: true
API requests will be made with worker within job queue and your messages or Botan.io statistics will definitely get delivered! See repo
Present Your 360° Panorama Images With JavaScript
More and more often you can see a cool 360° panorama. Today, I will play with two libraries that present images as 360° panorama views. I will test two libraries, first is Panorama Viewer by Pete R. which is the simplest I could find, and Three.js which is most complex one I could find. Both are free and easy to start with. Also, let’s do it in Rails! http://bamboolab.eu/blog/present-your-360-panorama-images-with-java-script
[Screencast] Database Index Optimization and Migration Maintenance
Adding indexes to your databases can increase the SQL search performance on your tables. As your application grows, migration files can become out of hand, use squasher to squish them down to a single file. https://www.driftingruby.com/episodes/database-index-optimization-and-migration-maintenance