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...

github.com

There are three ways to define your own RSpec matchers, with increasing complexibility and options: 1) Use RSpec::Matchers.define

When deploying Rails applications you might have noticed that JS and CSS are not cached by all browsers.

When you roll custom URLs with hacks like routing-filter, you can put a spec like this into spec/routing/routing_spec.rb:

When working with times and dates in Rails applications, you need to deal with the following problem: In Rails, Time...

So you screwed up and copied Paperclip secrets from one project to another. Here is a semi-automatic, painful way...

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

github.com

An alternative to this technique is using VCR. VCR allows you to record and replay real HTTP responses, saving you...

makandra dev
prototypejs.org

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

blog.peepcode.com

The Rails router has been written and rewritten at least four times2, including a recent rewrite for the upcoming Rails...

github.com

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

makandra dev

Dir.glob(File.join RAILS_ROOT, 'app', 'models', '*.rb').collect{ |path| path[/.+\/(.+).rb/,1] }.collect(&:camelize).collect(&:constantize)

sudo gem install gettext --no-ri --no-rdoc sudo gem install fast_gettext --no-ri --no-rdoc script/plugin install git://...

See the lemonade descriptions. Unfortunately, the gem has a few problems: it does not work with Sass2...

When you need to patch an existing gem, one way is to "vendor" the gem by copying it into the...

ActsAsSolr::Post.execute(Solr::Request::Delete.new(:query => "#{Location.solr_configuration[:type_field]}:#{ModelClass}")) ActsAsSolr::Post.execute(Solr::Request::Commit.new)

This can happen during development when classes without automatic reloading are pointing to classes with automatic reloading. E.g. some class...

makandra dev

Basic configuration Please keep this config simple. It should be a starting point for new developers learning Git. [user]

makandra dev
github.com

Gem to provide nice looking urls ("/blog/the-greatest-bug-i-never-fixed"). If you don't need anything too special (like i18n for the urls...

rubyrailways.com

I have been playing around with RESTful Rails recently. Below is my collection or Rails REST howtos, tutorials and other...

dehora.net

PUT means update the resource with this entity, which tends means "overwrite". Now think for a moment about how that...

amundsen.com

Once you start introducing partial updates, you open yourself for caching problems. doing partial updates means all cached copies of...

amundsen.com

i keep looking for ways to help people 'get' REST. not URLs or HTTP Methods; but REST itself - in a...