...the poor decisions made at every turn. “Why, oh why, is this built with Rails when Node.js would be so much better?” or “how could the previous developer not have...
...Windows VM copies them over a Samba share onto your machine. From inside your Rails project directory call regularly: geordi remove-executable-flags Runs chmod -x on Ruby, HTML, CSS...
...joins, ActiveRecord will make that record read-only. This is a protective measure by Rails because such a record might have some additional attributes that don't correspond to actual...
In Rails, you can very easily send emails with HTML and plaintext bodies. However, if you're trying to debug those using your normal email account, you might be out...
...to whatever you like (by returning old_value you'd get the behavior of Rails' reverse_merge!, by returning new_value you'd get the behavior of standard merge!).
...of workers to 1 and the other requests have to wait. UNICORN_WORKERS=1 rails server
...get it working, based off some useful instructions that are tailored for Ruby on Rails...
Then I should see "Welcome!" What happens here is that the Rails application serving pages runs in 2017, but the process running your browser still lives today...
better_errors is an awesome gem for enhanced error pages in development, featuring a live-REPL for some light debugging...
When your model is using a callback like before_save or before_validation to calculate an aggregated value from its...
...User.any_instance.stub(...) Note: You won't have RSpec 2.6 if you're still working on Rails...
...method and must have that CONSTANT there. Master mode is for you. Master mode (Rails 2) Put the attached file into your spec directory, then merge these lines into your...
...constant "CRAWL_SUBPAGES", false.\ Note: the constant must be given as String. Master mode (Rails 3) In Rails 3 applications you should prefer to set configuration options in Rails.configuration, which...
...but does not break on empty arrays. Note that try is provided by ActiveSupport (Rails). You could explicitly load activesupport or use andand on plain Ruby...
Whenever is a Ruby gem that provides a nicer syntax for writing and deploying cron jobs. Leading zeros are important...
I recently browsed through the ActiveSupport code and found some nice stuff I did not know about: ActiveSupport::Callbacks
...when you come back to the console later Calls RSpec 1 (spec) in a Rails 2 project and RSpec 2 (rspec) in a Rails 3 project Configures RSpec to use...
What you can do today. Example AOP-isms in Ruby on Rails. Aspect-Oriented Design. The AOP Promise for Tomorrow...
gem 'guard', '=1.8.1' gem 'guard-livereload', '=1.4.0', :require => false Notes for Rails 2.3 projects On Rails 2.3, you need to add the middleware like this: # config/environments/development.rb
...that is set to true when in test mode: class ExampleController < BaseController SKIP_CAPTCHA = Rails.env.test? ... Next, depend activation of that feature on the value of that constant: private
FactoryBot.define do factory :parent do transient do child_name nil child_allowed_to_drive false end child do association(:child...
...config.gem 'chunky_png', :version => '=0.8.0' create config/initializers/compass.rb (or copy from development repo): ^ require 'compass' rails_root = (defined?(Rails) ? Rails.root : RAILS_ROOT).to_s Compass.add_project_configuration(File.join(rails_root, "config...
^ This configuration file works with both the Compass command line tool and within Rails. Require any additional compass plugins here. project_type = :rails project_path = Compass::AppIntegration::Rails.root
When you use a belongs_to or has_many macro you might be surprised that the methods that it generates...
I recently noticed that better_errors allows you to to open files from within your favorite editor. However it was...
If an view spec crashes due to undefined helper methods, you can enable this option: # config/application.rb config.action_controller.include_all_helpers = true...