background preloader

Rails

Facebook Twitter

Rails 5.2 credentials – cedarcode. As announced in Rails 5.2.0 release candidate, Rails 5.2 will go out with a brand new credentials API that will eventually replace the current config/secrets.yml and config/secrets.yml.enc.

Rails 5.2 credentials – cedarcode

The intention behind this change is mainly to remove some of the confusion introduced by the combinations of config/secrets.yml, config/secrets.yml.enc and SECRET_BASE_KEY used in earlier versions of Rails, and attempt to unify everything using a more straightforward approach. 11 Best Freelance Ruby on Rails Developers for Hire in April 2019 - Toptal® The Technology Just as France’s Train à Grande Vitesse (TGV) (traveling at speeds of up to 320 km/h) dramatically reduces travel time for modern day rail passengers, Ruby on Rails (a.k.a.

11 Best Freelance Ruby on Rails Developers for Hire in April 2019 - Toptal®

“Rails”) substantially reduces the time and effort required to build powerful web applications. Tim O’Reilly (founder of O’Reilly Media) refers to Rails as breakthrough technology and Gartner Research noted in a recent study that many high-profile companies are using Rails to build agile, scalable web applications. The rate at which Rails has gained popularity is noteworthy, with estimates of over 200,000 web sites currently built with the technology. Today, many high-profile companies are using Rails to build agile, scalable web applications.

Rails is a framework for web application development, written in Ruby, that also features its own routing system independent of the web server. Global interpreter lock. Technical background concepts[edit] Applications running on implementations with a GIL can be designed to use separate processes to achieve full parallelism, as each process has its own interpreter and in turn has its own GIL.

Global interpreter lock

Otherwise, the GIL can be a significant barrier to parallelism. Drawbacks[edit] Reasons for employing such a lock include: Examples[edit] How to Choose Your Ruby Interpreters and Runtimes. Introduction Just as there are many shades of the ruby gem, there are multiple implementations of the Ruby interpreter.

How to Choose Your Ruby Interpreters and Runtimes

The most commonly used Ruby interpreter is the reference implementation, Ruby MRI, developed in C by the creator of Ruby (Yukihiro Matsumoto) and the Ruby core team. Our Ruby on Rails Hiring Guide mentions that some of the drawbacks in Rails can potentially be solved or avoided by using an alternate Ruby interpreter. Ruby Concurrency and Parallelism in Multithreaded Apps: A Tutorial. Let’s start by clearing up an all-too-common point of confusion among Ruby developers; namely: Concurrency and parallelism are not the same thing (i.e., concurrent !

Ruby Concurrency and Parallelism in Multithreaded Apps: A Tutorial

= parallel). In particular, Ruby concurrency is when two tasks can start, run, and complete in overlapping time periods. It doesn’t necessarily mean, though, that they’ll ever both be running at the same instant (e.g., multiple threads on a single-core machine). In contrast, parallelism is when two tasks literally run at the same time (e.g., multiple threads on a multicore processor). The Majestic Monolith - Signal v. Noise. Some patterns are just about the code.

The Majestic Monolith - Signal v. Noise

If your code looks like this, and you need it to do that, here’s what to do. Securing Rails Applications — Ruby on Rails Guides. Rails Considerations — Mongoid Manual upcoming. Building a Custom Logger with Active Support Tagged Logging. The ActiveSupport::Logger class is the go-to logging tool for Rails––the default Rails logger represents an instance of this class.

Building a Custom Logger with Active Support Tagged Logging

Active Support provides some additional flexible logging classes that we can use to customize logging functionality in our Rails app. The default logger allows us to set logging levels, for example WARN, or INFO, or ERROR, and log simple statements tagged with that level. Server-generated JavaScript Responses. The majority of Ajax operations in Basecamp are handled with Server-generated JavaScript Responses (SJR).

Server-generated JavaScript Responses

It works like this: Form is submitted via a XMLHttpRequest-powered form.Server creates or updates a model object.Server generates a JavaScript response that includes the updated HTML template for the model.Client evaluates the JavaScript returned by the server, which then updates the DOM. This simple pattern has a number of key benefits. ActiveRecord count vs length vs size and what will happen if you use it the way you shouldn't - Running with Ruby. Rails - filter using join model on has_many through. As of Rails 5, when is :inverse_of necessary to set manually? Exploring the `:inverse_of` Option on Rails Model Associations. Preload, Eagerload, Includes and Joins. Making sense of ActiveRecord joins, includes, preload, and eager_load. Rails Self Referential Associations – Adam D – Coding Enthusiast. I was building a Rails app which required a Contacts model to be able to relate to many other contacts where the relationship was reciprocal.

Rails Self Referential Associations – Adam D – Coding Enthusiast

Enumerated Types in ActiveRecord. Do you really need that fancy JavaScript framework? Rails 5.1's form_with vs. form_tag vs. form_for – Patrik on Rails. Tenderlovemaking. TL;DR Rails 4.0 will allow you to stream arbitrary data at arbitrary intervals with Live Streaming.

Tenderlovemaking

Besides enabling multi-threading by default, one of the things I really wanted for Rails 4.0 is the ability to stream data to the client. I want the ability to treat the response object as an I/O object, and have the data I write immediately available to the client. How DHH organizes his Rails controllers - Jerome's Adventures in Software. In a recent interview with Full Stack Radio our Lord and Savior DHH™ explains how he organizes Rails controllers in the latest version of Basecamp. Here is an enhanced transcript of his holy words: What I’ve come to embrace is that being almost fundamentalistic about when I create a new controller to stay adherent to REST has served me better every single time. Every single time I’ve regretted the state of my controllers, it’s been because I’ve had too few of them. Buckblog: More on watching ActiveRecord. Ruby requires confusion – Benjamin Fleischer.

Message to Ruby Rogues mailing list TL;DR autoload looks great and is used all over rails, but it’s not threadsafe and Matz said not to use it, prefer require or require_relative. Which one is true; is somebody wrong on the internet? Content-Encoding: links, quotes and discussion Content-Disposition: confused Some time ago I got in the habit of always calling require with an absolute path require File.expand_path('.. to ensure that all require arguments are full-paths and hence the same file is never loaded twice by a require statement. In reading Jose Valim’s Crafting Rails Applications (awesome!) Clarifying the Roles of the .gemspec and Gemfile. Although apps and gems look like they share the concept of "dependency", there are some important differences between them. Gems depend on a name and version range, and intentionally don't care about where exactly the dependencies come from. Apps have more controlled deployments, and need a guarantee that the exact same code is used on all machines (dev, ci and production).

When developing a gem, use the gemspec method in your Gemfile to avoid duplication. In general, a gem's Gemfile should contain the Rubygems source and a single gemspec line. Named Gem Environments and Bundler. In the beginning, Rubygems made a decision to allow multiple versions of individual gems in the system repository of gems. This allowed people to use whatever versions of gems they needed for individual scripts, without having to partition the gems for specific purposes. This was a nice starting place. TDD, Straw Men, and Rhetoric. In a blog post called Slow database test fallacy, David Heinemeier Hansson, the creator of Rails, begins: The classical definition of a unit test in TDD lore is one that doesn't touch the database.

First, you can immediately tell that this piece of writing is going to be heavily rhetorical. He refers to "TDD lore" as opposed to, say, "TDD practice". By using the word "lore", he positions it as subjective, unreliable, mythological. Second, that sentence is false. Test Isolation Is About Avoiding Mocks. Isolated testing has an easily identified villain: the deeply-nested mock object.

RailsConf 2014 - Debugger Driven Developement with Pry by Joel Turnbull. Ubuntu, Ruby, ruby-install, chruby, Rails and You - Ryan Bigg. Transactions - RSpec Rails - RSpec - Relish. Plataformatec/devise. Ruby - Are there any basic examples of Rack. Sinatra Authentication with Warden. Sessions, Cookies, and Authentication. Introduction. How Rails sessions work - Justin Weiss. Understanding Rack Apps and Middleware. Leah blogs: Introducing Rack. ActiveRecord. ActiveRecord. GORUCO 2018: Writing Ruby Like it's 2018 by Joe Leo. Submodules. Live without Devise: a simple Warden authentication service.

Wardencommunity/warden: General Rack Authentication Framework. Remote authentication with devise - 4Trabes.