A good tool to generate strong passwords and secrets is "apg". You can get it with sudo apt-get install...

Both these approaches will keep your GET parameters – and will only work for GET requests. Capybara: When /^I reload the...

When Paperclip attachments should only be downloadable for selected users, there are three ways to go. The same applies to...

This will show you how to create a RSS feed that the Feed Validator considers valid. Note that RSS is...

The following solution will delete files on a volume. If you don't know exactly what you're...

emphaticsolutions.com

In a great post about named routes in Rails, path vs. url, Viget Labs ponders which variant is best used...

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