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.
A Content Security Policy (CSP) strategy
A Content Security Policy is a great way to reduce or completely remove the number 1 web app security vulnerability – Cross-Site Scripting (XSS). You’ll need a strategy to introduce it, though.
Domain Events over Active Record Callbacks
There has been a lot of discussion recently over AR callbacks. What are their good and bad consequences and so on. Check out the alternative approach. Domain Events over Active Record Callbacks
Join a Ruby Remote Meetup
If you would like to join a Ruby Remote Meetup group: [more inside]
The low-down on Ruby Modules
A visual representation on what we can do with Modules and how they fit into the Ruby Object Model https://www.sitepoint.com/get-the-low-down-on-ruby-modules/
The Right Format
Examples of all formatting types and flags for sprintf formatted strings [more inside]
xray-rails: Quickly identify and edit Rails views in the browser
Just add xray-rails to the development group your Gemfile. Now you can press SHIFT+CMD+X (Mac) or SHIFT+CTRL+X (others) for a visual breakdown in your browser of all the Rails layouts, views, and partials that rendered the page. Click anywhere on the page to launch your preferred code editor for the corresponding Rails view. Now with Rails 5 support!
A change-positive Ruby web application architecture
A look past Rails, past MVC, towards a web application architecture that promotes ease of change: http://icelab.com.au/articles/a-change-positive-ruby-web-application-architecture/
Docker: Running a Rails App Container with Elasticsearch Service
In this episode Zack Siri declares his love for error messages and show you how to connect your rails app container to an elasticsearch service. We also show you how to configure your elasticsearch container by modifying the config file.
RSpec and Rails are Mocking Me
This post is about a very small Rails design decision. A Rails design decision that I’ve made over and over without thinking about it. You probably have, too. And then a weird test failure made me think about it. And then it made me overthink it.
Building Microservices with Docker and the Rails API gem
Charles Wang sets up a basic Rails API app as a microservice. Microservices provide loose coupling, strong cohesion, independent deploys, and much more.
5 Useful Examples From The Ruby Standard Library
The Ruby Standard Library has some useful classes & methods, in this post I show 5 examples. http://www.blackbytes.info/2016/05/ruby-standard-library/
Don't just DRY your code, DRY your tests too!
I’m a big fan of having small classes. I’m not a big fan of having huge specs for a small class/object. Every time I see an opportunity to DRY my specs, I take it. [more inside]
Maintaining a consistent coding style across projects with house_style
When using RuboCop, maintaining a consistent style across multiple projects can be a chore if you manage the configuration yourself. house_style is our solution. Read about the thinking behind it, and how we set it up within each application, on our blog post: [more inside]
The journey to Rails and TDD
TDD is a great technique, but may leave you uncertain what exactly to do with the Refactor phase [more inside]
Doorkeeper Sequel ORM extension
doorkeeper-sequel gem provides Doorkeeper 4.0 (Ruby on Rails OAuth2 provider) support to Sequel database toolkit.
Procs and Lambdas: Closures in Ruby
Check out the latest post at the “Zen Ruby” blog: Procs and Lambdas: Closures in Ruby.
BrainRuby - Maximally Obfuscated Ruby
This totally useless, but fun, hack to allow you to write any Ruby code using just 10 non-alphanumeric characters. Check out the repo and/or watch the explanatory video.
Reading Rails - HTTP DELETEs With a Link
Links are normally always performed as HTTP GETs, but with a little magic Rails lets you do DELETEs, POSTs, PUTs, etc. We’re going read some source code and see how Rails, Rail-UJS, and Rack all work in concert to provide this functionality. Even if you don’t give a damn, I’ll bet you’ll learn something neat.
Ruby meets Creativity at TRIC
Have you taken a look at the winning submissions of the last two Transcendental Ruby Imbroglio Contests? It is astonishing: 1st edition, 2nd edition!