...them into their corresponding CSS files inside public/stylesheets. When your project uses Lemonade just call: compass watch When using the latter you do not need to sass --watch explicitly as...
...same id attributes for fields again. This card presents you with a way to call something like - form_for @user, :prefix => 'overlay' do |form| = form.text_field :email
...make the warning go away. Make sure to put it above all other config.i18n calls, or the warning might not disappear. config.i18n.enforce_available_locales = false If the warning still sticks...
...test, you can disable this behavior for pending features only. To make any pending call reconfigure the current cassette, you can simply redefine it. There is no official API to...
...the initial migration.\ So, in your new migration, just include the old one and call it: require 'db/migrate/20120201031337_add_population_to_destinations' class DropPopulationFromDestinations < ActiveRecord::Migration def self.up AddPopulationToDestinations.down end def self.down AddPopulationToDestinations.up
...s Bundler environment will shadow that of the test application. To fix this, just call unset_bundler_env_vars in a Cucumber Before block. Previously suggested solution Put the snippet...
...you need to turn to linear functions. The mixin below gives you just that. // Call with two desired values at two different widths. // Returns a calc() expression that will scale...
...cache the result after calculating it once. However, you can trigger a recalculation by calling #life_universe_and_everything(true). If, however, your method looks like def life_universe(and...
...everything = false) ... end memoize :life_universe a call to #life_universe(true) will actually trigger a reload and not pass the parameter at all. To clarify: This not only disables...
...You will also need Ubuntu development packages for MySQL, RMagick, etc. The bundle install call will otherwise fail for such projects...
The most common use case for Ruby's #collect is to call a method on each list element and collect the return values in a new array: ['hello', 'world', 'this...
...If you are using the Prototype framework, there is also a method called pluck: ['hello', 'world', 'this', 'is', 'nice'].pluck('length...
...is, you must tell the debugger to evaluate your expression. One workaround is to call irb to open an irb session at your breakpoint. Resume by sending Ctrl+D twice...
#<OrderItem id: 111471, quantity: 5,...
The debugger has a setting called autoeval that will make it pass any unknown command to the breakpoint environment. Set it...
Turns a Hash into a Proc that returns the corresponding value when called with a key. May be useful with enumerators like #map: attrs.to_proc.call(:name) attrs.keys.grep(/name/).map...
...curb dependencies: gem webmock, '>= 1.8.0' gem curb, '>= 0.7.16' For me this happened when stubbing calls for Savon, which was using Curb in the background...
...that you need to remove trailing white space from the result of the system call. >> `hostname` => "happycat\n" >> `hostname`.strip => "happycat" Note that this is about the machine's hostname...
...via Spring preloader in process 14679 Loading development environment (Rails 5.2.2.1) Traceback (most recent call last): .../lib/ruby/gems/2.6.0/gems/spring-2.1.0/lib/spring/application.rb:175:in 'fork': No such file to load -- irb/encoding_aliases.rb (LoadError) .../lib/ruby/gems/2.6.0/gems/spring-2.1.0/lib/spring/application.rb:175:in...
...reject!' for nil:NilClass (NoMethodError) The solution is to upgrade the gem binding_of_caller to version 0.8.0. Found that solution here...
...in geordi) and mark others as deprecated Add hint to README about how to call the local geordi during development
...is some code to allow using unobtrusive JavaScript on pages fetched with an AJAX call. After you included it, you now do not use the usual $(function() { $('.some_tag').activateStuff...
...to elements nested below $(this) Normal pages work as before (your $.unobtrusive functions are called automatically), but you gain the option to manually run those by calling $(newContent).activateUnobtrusiveJavascript();
...Put the attached script into e.g. /usr/local/bin and make it executable. Now you can call fullscreen Safari and Safari will go full screen. Notes This script needs activated access for...
...helper that you can use to travel through time and trigger setTimeout and setInterval callbacks: beforeEach(function() { timerCallback = jasmine.createSpy("timerCallback"); jasmine.clock().install(); }); afterEach(function() { jasmine.clock().uninstall(); }); it("causes a timeout...
...to be called", function() { setTimeout(function() { timerCallback(); }, 100); expect(timerCallback).not.toHaveBeenCalled(); jasmine.clock().tick(101); expect(timerCallback).toHaveBeenCalled(); }); If you actually want the test to wait out the timer, your example...
...the last argument of the previous command. Example: Check with "ls foo*" first and call "mv !$ /tmp" afterwards. Combined commands Ctrl + (C P O) Cancel the running command, go to...
In the tradition of our PostgreSQL cheat sheet for MySQL lamers, here is a cheat sheet for Jasmine when you...
...often include Javascript code that contains values from Ruby variables. E.g. you want to call a Javascript function foo(...) with the argument stored in the Ruby variable @foo. You can...
The most obvious way to use spring is to call it explicitly: spring rails console spring rake db:migrate Binstubs Binstubs are wrapper scripts around executables. In Rails they...
...Spring by setting the environment variable DISABLE_SPRING. Obviously, this does not work when calling Spring explicitly...
...like user.version_at(10.hours.ago). Diffing attribute changes : Access a Version directly, like user.versions.last and call its changeset: user.versions.last.changeset => { 'first_name' => [ 'Alice', 'Bob' ], 'gender' => [ 'female', 'male' ] } Tracking who made the changes...