makandra dev

There are two distinct ways of commenting Haml markup: HTML and Ruby. HTML comments This will create an HTML comment...

makandra dev

This is an awesome gadget in your toolbox, even if your test coverage is great. gem install ruby-debug (Ruby...

To return non-HTML responses (like XLS spreadsheets), we usually use the respond_to do |format| format.xls do # send spreadsheet...

Rails 3, 4, 5, 6 config/application.rb config/environment.rb before the initialize! call (we don't usually edit this file)

makandra dev

Update RubyGems and Passenger Bundler requires Rubygems >= 1.3.6. Run gem update --system if you have an older version.

This might eventually be fixed by Rails itself.\ Right now this is the way to have the rails_xss plugin...

Sometimes files attain executable-flags that they do not need, e.g. when your Windows VM copies them over a Samba...

When you need to add a event listener to hundreds of elements, this might slow down the browser. An alternative...

Don't use should validate_format_of(...) because that matcher works in weird ways. Use the allow_value matcher instead...

Use this if you want to show or hide part of a form if certain options are selected or boxes...

regular-expressions.info

You can write regular expressions some different ways, e.g. /regex/ and %r{regex}. For examples, look here. Remember that it...

github.com

jamesgolick / resource_controller at Github module ResourceController module Actions def index load_collection before :index response_for :index end

Capybara does not play nice with sites that have some actions protected by SSL, some not. A popular way to...

github.com

Our awesome collection of rspec helpers (formerly known as "spec_candy.rb") is now available as a gem. It works, it is...

github.com

home_run is an implementation of ruby’s Date/DateTime classes in C, with much better performance (20-200x) than...

tinyMCE.activeEditor.getContent()

prototypejs.org

For example, to send a form and populate a preview div with the response. $('content_form').request({ parameters: { 'preview': "1...

github.com

Ancestry is a gem/plugin that allows the records of a Ruby on Rails ActiveRecord model to be organised as a...

In Webkit you can use the HTML5-attribute autofocus: = form.text_field :title, :autofocus => 'autofocus' Here is a jQuery fallback for...

Most of these will not work in newer projects because these use the Capybara/Rack::Test combo in lieu of Webrat...

Until May 2011 our gems have been created with Jeweler, which is a helper library to package code into a...

With defaults, RCov doesn't work the way you how you would like it to. To create a nice test...

github.com

We built cucumber_spinner to have a progress bar for Cucumber features, which also outputs failing scenarios as soon as...

To parse XML-documents, I recommend the gem nokogiri. A few hints: xml = Nokogiri::XML(" foo bar ") parses an xml...