...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!).
In the ruby shell (IRB) and rails console the return value of the previous command is saved in _ (underscore). This might come in handy if you forgot to save the...
...Ruby couterpart. Thus, it does a great job as YAML-doc, e.g. when writing Rails locale files. Did you know that ... << is a merge key (similar to & in SASS)
When a Rails controller action should handle both HTML and JSON responses, do not use request.xhr? to decide that. Use respond_to. I've too often seen code like this...
...to remember the password, give a form an autocomplete attribute with the value off: ... Rails example form_for @model, :html => { :autocomplete => "off" } do |form...
Under certain circumstances gettext_i18n_rails will hit a near-infinite loop. This occured in Rails 2.3.5 with Haml 3.0.18 and fast_gettext 0.5.10. gettext_i18n_rails's Haml-Parser...
...on our radar for a while. They seem to have made significant progress running Rails, reducing start-up time and becoming runtime-independent of the JVM. Also see Running Optcarrot...
If you have a file that looks like a precompilation fingerprint, the Rails asset pipeline will not see it. So don't have filenames like this: 8e21264d-f678-4005-b90c-8d8288a0d179.ttf
...t say is_a?(ActiveRecord::NamedScope::Scope) because that is no longer true in Rails 3 and also doesn't match unscoped ActiveRecord classes themselves (which we consider scopes for...
...remember to set your values with field=#{quoted_true} and field=#{quoted_false}. The Rails methods quoted_false and quoted_true return the correct boolean representations for your database...
...sub directories, make sure to add -r features to the standard Cucumber options. In Rails apps, Cucumber options are likely to be stored in config/cucumber.yml...
...won't notice it during development. But with caching active (on production or staging) Rails will write an empty all.js file without complaining...
...Sass and Less files, so the theme can easily be integrated into your usual Rails application. Implements only Bootstrap features which means that some Material stuff is missing, but also...
...outputs a Rack application which you can either serve standalone or mount into your Rails app...
...User.any_instance.stub(...) Note: You won't have RSpec 2.6 if you're still working on Rails...
This is what worked for me in a Rails 4: # JSON data as first argument, then parameters patch :update, { some: 'data' }.to_json, id: id, format: :json
Ruby 1.9.2 is very slow when loading files, especially starting Rails servers or running specs takes forever. Do yourself a favor and upgrade to...
...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...
...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
...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...
If you specify different ports, you can run multiple local webricks with rails server --port=300X at the same time...
...Minidusen, which extracts those parts from Dusen. Minidusen is compatible with MySQL, PostgreSQL and Rails 3.2, 4.2 and 5.0. If you are looking for a full text indexing solution, we...
...your working directory that you cannot remove by either checkout, reset [--hard], stash, probably Rails' Spring is the culprit and not Bundler itself. Fix spring stop The author of the...
...for old IEs. Unfortunately, their auto-loading mechanism may not work properly on your Rails application due to the asset pipeline. They use FileAPI, so you could just include it...