stackoverflow.com

Using beginning_of_day or end_of_day on Date or DateTime objects in Rails 2.x applications will never...

If (for some reason that you don't want to ask yourself) you need to know all classes that define...

It seems like changing the HTTP_ACCEPT_LANGUAGE is not possible for a headless chrome. On Ubuntu the headless Chrome...

Rails includes milliseconds in Time / DateTime objects when rendering them as JSON: JSON.parse(User.last.to_json)['created_at'] #=> "2001-01-01...

There seems to be a nasty bug in Chrome 56 when testing with Selenium and Capybara: Slashes are not written...

bugs.ruby-lang.org

TL;DR Under certain circumstances, dynamically defined symbols may break keyword arguments in Ruby 2.2. This was fixed in Ruby...

Note: Consider not doing this. Use form models or vanilla methods instead. The :conditions option for Rails associations cannot take...

}, "_type": "post", "_version": 1, "result": "created" } Suchen http GET :9200/my_documents/_search?q=tobias { "_shards": { "failed": 0, "skipped": 0, "successful": 5, "total": 5 }, "hits": { "hits": [ { "_id": "1", "_index": "my_documents...

The state_machine gem ships with a scope with_state. This scope has some problems in complex queries or scope...

ActiveRecord provides the ids method to pluck ids from a scope, but what if you need to pluck Global IDs...

When rendering a number, you want to pretty up the string coming from #to_s: Render 0.0 as 0

Add deprecation warnings and their solution or link to available solutions. Global access to Rake DSL methods is deprecated. Please...

Note that this seems to affect only recent Rails 2 versions. You will not encounter this until you are writing...

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

If - for whatever reason - you have to render stylesheets dynamically, the following snippet might be of help. It emulates what...

This is more tricky than it should be because url_for, asset_path, etc. all rely on different mechanisms.

Accessing pseudo elements via JavaScript or jQuery is often painful/impossible. However, accessing their styles is fairly simple. Using getComputedStyle

Our rspec_candy gem now gives you three matchers: be_same_number_as Tests if the given number is the...

We use CarrierWave in many of our projects to store and serve files of various formats - mostly images. A common...

Lets say we have a user with a contract whereas contract is a mounted carrierwave file. Now we want to...

The code below shows a method #validate which uses Nokogiri to validate an XML document against an XSD schema. It...

You can usually just use the eq matched to compare two numbers: expect(deal.total).to eq(120)

Dump this method into your Ruby console to quickly print data in columns. This is helpful for e.g. comparing attributes...

There seems to be no built-in matcher in RSpec to check if a string contains terms in the desired...