...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...
...Whenever generated tasks for: some-app_staging 34 23 * * * /bin/bash -l -c 'cd /var/www/some-app_staging/releases/20201215171150 && RAILS_ENV=staging bundle exec rake some-task' # End Whenever generated tasks for: some-app_staging...
# Begin Whenever generated tasks for: /var/www/some-app_staging/releases/20201215171150 34 23 * * * /bin/bash -l -c 'cd /var/www/some-app_staging/releases/20201215171150 && RAILS_ENV=staging bundle exec rake some-task' # End Whenever generated tasks for: /var/www/some-app_staging/releases/20201215171150 # Begin Whenever...
...put it into app/util and configured application.rb like that: # catches 'invalid %-encoding' error require "#{Rails.root}/app/util/exception_app" config.middleware.insert_before Rack::Runtime, ExceptionApp::Middleware Note: Rails 4.2+ raises an ActionController::BadRequest error...
...which includes all webpack config options set for the current environment: const { environment } = require('@rails/webpacker') const webpack = require('webpack') throw JSON.stringify(environment, null, 2) ... Option 2: Browser console
...Resume script execution" to jump to the your set breakpoint Option 3: Node console $ RAILS_ENV=development node const config = require('./config/webpack/development') Option 4: Printing warnings const process = require('process...
--require spec_helper If you are on rspec >= 3 and use a rails_helper.rb require this instead of the spec_helper: --require rails_helper If you are using parallel...
You can significantly improve performance by adding this to config/initializers/better_errors: if defined?(BetterErrors) && Rails.env.development? module BetterErrorsHugeInspectWarning def inspect_value(obj) inspected = obj.inspect if inspected.size > 20_000 inspected = "Object was...
On your credit card summary, you will find order numbers of rides with Deutsche Bahn ("DB BAHN A-NR XYZ123...
...disable it in tests, by adding a body class for tests %body{'data-environment' => Rails.env} overriding the transforms [data-environment="test"] * text-transform: none !important
Added an example and removed the redundant before_destroy.
Consul no longer uses ActiveSupport::Memoizable because that's deprecated in newer Railses. Consul now uses Memoizer for this. Temporarily change the current power When you set Power.current...
Instead of running all missing migrations on your test database with rake db:migrate RAILS_ENV=test you can also use a handful of rake tasks to prepare the database...
or use rake db:test:clone_structure ← preferred :) or use rake db:migrate RAILS_ENV=test and don't mix it with other ways, like some of the rake...
mysql> SELECT @@global.version; +------------------+ | @@global.version | +------------------+ | 5.6.30 | +------------------+ 1 row in set (0,00 sec) MySQL 5.6 Reference Manual says "BLOB and TEXT...
...remote log files' task :logs do on roles :app do logfile = ENV['LOG'] || fetch(:rails_env) execute %(tail -n0 -F #{shared_path}/log/#{logfile}.log | while read line; do echo...
For all of my professed admiration of Ruby on rails, I personally don't think that easier and more productive CRUD application writing will shake things up. I personally care...
...very much about writing applications in a tenth of the time, but using Rails is like listening to Jaco Pastorius. The real learning experience comes when you try to duplicate...
The ancestry gem allows you to easily use tree structures in your Rails application. There is one somewhat unobvious pitfall to it: its way of applying the orphan_strategy which...
...More than twice the amount of courses is probably not sensible, booting up rails takes its time, too...
Today I needed to execute a ruby gem executable with sudo. But, surprisingly, bash would tell me command not found...
ActiveSupport's memoize has a dangerous feature you might not know about. Assume you have class DeepThought extend ActiveSupport::Memoizable...
Cucumber_rails' old-school web-steps have been deprecated for a while, urging developers to write high-level step definitions that directly use Capybara or Webrat. We think that's...
...user symbol in the hash of inclusions turned into a "user" string.\ This breaks Rails' loading of associations as it will complain about calling nil.name or nil.macro while it tries...
The tagged_with scope comes with many awesome options to modify your search: User.tagged_with("awesome", "cool") # Users that are...