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.
Making broken SJR templates easier to debug
Have you ever spent an embarrassingly large amount of time debugging a broken SJR template? Having been there myself, I’ve isolated 3 different types of errors that are most commonly to blame. Knowing which one is the culprit makes debugging and fixing a js.erb template SO much easier.
http://www.carlosramireziii.com/3-reasons-why-your-sjr-template-isnt-working.html
Running rubocop before git commit
Lately I got annoyed by myself for breaking our Ruby style guide and only noticing after a CI run. Turns out git hooks in combination with pronto are awesome: https://christoph.luppri.ch/articles/2016/11/21/running-rubocop-before-git-commit/
Duck Typing
Engineering our objects with Duck Typing in mind can save us time and effort, and minimize changes to our existing code. Read about Duck Typing
Another useful extension for KMS
This simple extension allows submitting contact/callback/feedback forms from frontend side and having it under “Messages” section in KMS - https://github.com/webgradus/kms_feedback
Importing data to database in Rails 50 times faster than normal
Have you ever needed to save lots of records with unique attribute to database using ActiveRecord? Have you noticed how time consuming such task is? I would like to show you how to do it quickly. http://naturaily.com/blog/post/importing-data-to-database-in-rails-50-times-faster-than-normal
[Screencast] Charts and Graphs
Learn how to use one of three charting libraries, Chart.js, Highcharts, or Google Charts, using the Chartkick gem to create simple and unobtrusive charts in your application. https://www.driftingruby.com/episodes/charts-and-graphs
Passing block with Enumerable#chunk is not mandatory in Ruby 2.4
Enumerable#chunk does not require a block to be passed along with it in Ruby 2.4 [more inside]
Tool to manage Gemfile
gemfile_locker can lock all (or selected) dependencies strictly or semi-strictly (with ~>), so it gets safe to run bundle update anytime. [more inside]
Keeping code DRY and maintainable with bottled_services
Without services in my code, I would be lost, to me just like controllers and models they are an essential part of any rails project, and after looking around and trying various gems I failed to find one that fits my exact needs, so i made one, and wrote a simple introduction blog about it too. ps. this is my first gem, go easy on me ;)
kramdown 1.13.0 - new man page converter, GFM enhancements
The next version of kramdown was just released, with a new converter for creating Unix man pages as well as some enhancements to the GFM parser - see http://kramdown.gettalong.org/news.html.
Ruby Elixir Nodejs Tools Comparison Matrix
Recently, I looked into Elixir and Nodejs and each has its own set of tools that are very similar to the tools I’ve seen in Ruby. It helped me a lot list out a map of the tools. Here it is in case it is helpful for others: https://blog.gitresolve.com/ruby-elixir-nodejs-tools-comparison-matrix-316e278793f9#.6cgmuz1r2
StubServer: Boot a real server for test replies
StubServer can be used for integration tests when stubing does not work or an actual server is needed.
Developed gem make_model_searchable for adding simple search functionality to models
Here’s the link to gem make_model_searchable. This gem provides moduler solution to add search functionality for selected fields. It let’s specify which fields you want to make searchable adding searchable_attributes in model. If no field is specified it searches given query string inside all string fields. It uses ARel nodes for implementing search. To have a look at source code or to contribute please visit github repository for make_model_searchable Support for associations will be added soon. Please review it and give me your valuable feedback and suggestions to my github repo. Thanks.
New invoicing tool made with rails
Hi everybody. The subject of this post may appear an little offtopic and maybe it is. I’ve created an Invoicing tool for freelancers and small companies. The reason I post it here is becasue it’s made with Rails. I’m freelancer too, I’m near the 40’s, I have two kids and I refuse to spent all my life doing this and that for others so I started developing a product by myself. I’ve written this post is because I think that I will have a chance if someone with the same point of view decide to join me in this adventure trying to create something that can be useful for other people that maybe someday will be able to pay our bills. So, please, give it a chance. You can sign in at https://billing.insitu.tools. If after messing a bit around in the website you decide you want to join, please email me to jsperezg at insitu dot tools or at jsperezg at gmail dot com. If you don’t want to join, but you thing it can help you in some way you’re welcome. I’ll be pleased to hear your complains or ideas and I will implement them as soon as possible. In any case, thank you all for your time and patience. PD: I forgot to say that it’s free.
What is your static site builder / generator of the year 2016? (Ruby Edition)
Hello, At the Static Times I’ve started a poll for the static site builder of the year 2016. The candidates include: (o) Middleman (o) Jekyll (o) Nanonc (o) Other? Let us know. ++ The poll runs for five days (on Twitter). You’re invited to add your vote. Thanks. Cheers. [more inside]
Rails SQL Injection Guide Updated with Rails 5
http://rails-sqli.org/ lists surprising SQL injection risks in regular ActiveRecord methods. It has been now been updated to include coverage of Rails 5. [more inside]
Rails caching with dalli gem
Dalli is a high performance pure Ruby client for accessing memcached servers. It works with memcached 1.4+ only, as it uses the newer binary protocol. Read On More about Rails Caching with Dalli Gem
factbook.json & gem - Turn the World Factbook into Open (Structured) Data w/ Ruby
Hello, for some more info and background about the factbook gem and the free public domain factbook.json datasets and the C.I.A. World Factbook - I’ve put together talk notes titled “factbook.json - Turn the World Factbook into Open (Structured) Data” for the Open Data Vienna meetup. Enjoy. PS: Trivia quiz: What country has the most crude oil - proved reserves (according to the World Factbook)?