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.
Thorough refactoring of a class (real-life OSS project)
I wrote a refactoring article http://rubyclarity.com/2015/08/paginatedresource-refactoring/
Solving Backwards Compatibility with a Proxy Object
I wrote a new article on Solving Backwards Compatibility with a Proxy Object. Hope you enjoy!
Two Factor Authentication in Rails 4 with Devise, Authy and Puppies
The most common passwords of 2015 list was just released and “123456” is top again. You can protect your users from themselves by implementing two factor authentication. Here’s how to implement two factor authentication using Rails, Devise and Authy.
Upgrading to Ruby on Rails 5.0
I just wrote a blog post about the process of upgrading one of ours Ruby on Rails apps from 4.2.5 to 5.0.0.beta1.1
Ruby Private Class Methods
In the Ruby programming language, defined methods come in two variants: instance methods and class methods. Instance methods are available after an object has been initialized, creating an instance. Class methods, on the other hand, are available without creating an instance of the class they are defined upon. However, Ruby class methods have some odd visibility quirks that might not be evident immediately.
Clearance, the other Rails authentication gem
I spent some time checking out Clearance as an alternative to Devise and my usual go-to, has_secure_password, for authenticating Rails apps. Check out my notes at Everyday Rails.
New Rails Versions with 9 CVEs fixed
http://weblog.rubyonrails.org/2016/1/25/Rails-5-0-0-beta1-1-4-2-5-1-4-1-14-1-3-2-22-1-and-rails-html-sanitizer-1-0-3-have-been-released/ Unlike usual, the version number is NOT increased in patch level but AFTER it So look closely to the post
Writing a Secure Filename Sanitization Function
One part of good security is writing a proper whitelist or blacklist function when interacting with files from users. Find out how to do that properly!
RSpec performance testing matchers
Motivated by latest failures maintaing code speed, the rspec-benchmark aims to help you prevent code performance regressions. Having benchmarks folder is fine, but automation integrated with the test suite keeps your code even more honest when refactoring. Give it a try and let me have your thoughts!
Wye Tech News #8
A new issue of our weekly compilation of interesting news and articles about Ruby, Rails, JavaScript and web development related stuff that we found during the week.
Create An Bash Function To Open Latest Active Record Migration
Opening the latest activerecord migration with those timestamps is tricky. Make it easy with this Bash function. http://solidfoundationwebdev.com/blog/posts/create-an-bash-function-to-open-latest-active-record-migration
Best practices to confident coding
“It works” — the client says after 5 or 6 clicks on the software you have created, deep breath and relax shoulders right?, next?: payment or some arrangement, after?: improvement, fixing some details… https://medium.com/@ccverak/getting-confidence-a-software-developer-perspective-1b7fee3bd643#.11yvybh76
Engine-based Rails Apps: Pros & Cons
A rundown of the pros & cons we encountered building a Rails app as a series of engines, rather than a monolith.
Another post about services in Rails and Faat-generator!
Hello, everyone! I released a new version of my gem-generator Faat!. And wrote a little article about how to use services in Ruby on Rails, and why it is important! And an example of how to use my gem-generator Faat!
cdnget - utility to download files from CDN
I released cdnget ver 0.1, a small utility to download files (*.js, *.css) from public CDN (CDNJS, jsDelivr, Google). See https://github.com/kwatch/cdnget for details.
Lotus is now Hanami
We decided to change the name to the project, here’s why. The name is a tribute to Matz and Ruby origins.
Custom templates path for controller
2 ways to specify custom templates path per controller http://undefined-reference.org/2016/01/23/custom_templates_path_for_controller.html
Cells-Hamlit: The Fastest View Engine Around.
Hamlit is a new, fast implementation of Haml. The Cells-hamlit gem allows speeding up your views in Cells. Check out our benchmarks with Cells and Haml, Hamlit and Slim.
Create worldmap colored by your stats
Simple gem for creating colored world map according to some statistics or custom rules: Worldize. Inspired by R’s rworldmap package.
Should I create a model if it will only have 1 row?
It can seem like overkill to create a database table and a corresponding ActiveRecord model if you know for a fact that your table will only have one row. Check out this post I wrote which looks into some options. Hope you enjoy!