dusen and edge_rider gems no longer depend on Rails

dusen 0.4.8 and edge_rider 0.2.3 no longer depend on Rails (they still depend on ActiveRecord). That means you can use them e.g. with Sinatra.

External content

Concerned about Concerns?

With Rails 4, Concerns have become the “official” solution to the big-models problem. However, there’s a fair amount of controversy about this topic in the community. Not everyone is convinced that Concerns are the “right“ solution to the problem of AR models becoming too big.

In this talk we will see what Rails Concerns are and how can we use them to keep our models fit. More interestingly, we’ll discuss the trade-offs of this technique, the different views in the community and a couple of alternatives.

.rvmrc deprecated in favor of .ruby-version and .ruby-gemset

Do not use .rvmrc files to specify Ruby version and gemset configuration any longer, it's deprecated and not considered by other Ruby version managers such as rbenv.

If you want to migrate an existing .rvmrc you can use rvm rvmrc to .ruby-version.
Put gemset specification into .ruby-gemset.

Creating the .ruby-version file on your own, just make a file containing e.g. 1.8.7

Attention: Don't clutter other developers rvms with several unecessary ruby patch levels

When you use the rvm command
rvm –ruby-version use 1….

Outlook deletes iCalendar ICS eMails and moves them to trash folder

We sometimes send calender data or tasks using iCalendar (ICS) via eMail as specified in RFC 5545.

Recently, a customer noticed that Outlook automatically moved eMails containing such ICS data to deleted items folder and shows the events as tentative on calendar.
This problem is reported on TechNet, for example.

It …

Use bundle open to open a gem's code in your $EDITOR

bundle open BUNDLED_GEM will open the BUNDLED_GEM's source code in your default editor.

Consul 0.10.0 allows multiple power mappings for nested resources

Consul 0.10.0 now allows multiple power mappings for nested resources.

When using nested resources you probably want two power
checks and method mappings: One for the parent resource, another for the child resource.

Say you have the following routes:

resources :clients do
  resources :notes

And the following power definitions:

class Power

  power :clients do if si...
External content

Building Custom Text Strikethroughs with CSS

Did you know you can color your line-throughs or underline, or make them wavy like spell-checkers do?

External content

What are the best programming fonts?

Long list of fonts suitable for coding. With screenshots.


For all late night coders:

The program "redshift" changes your monitors' white balance according to your position on the planet and your local time. This is supposed to put less strain on your eyeballs than staring at a "daylight white" screen all day and night.
The program is in the Ubuntu repositories, so a simple "sudo apt-get install gtk-redshift" transfers it onto your hard drive.

I find the effect rather pleasing and so I have set the following alias on my computer:

alias rdshft='gtk-redshift -l 48.3714407:10.8982552 -t 6500:4200 &'…

Custom RSpec matcher for allowed values (or assignable_values)

In contrast to RSpec's included allow_value matcher, the attached matcher will also work on associations, which makes it ideal for testing assignable_values.

Usage example

describe Unit do

subject { }

describe '#building' do

it 'should only allow buildings that a user has access to' do
  user =
  granted_building = FactoryGirl.create(:building)
  denied_building = FactoryGirl.create(:building)

  Power.with_power( do

Raise when there's a I18n translation missing

The translation method translate and its alias t have bang brothers: translate! and t!. They will raise I18n::MissingTranslationData on a missing translation instead of printing a string like translation missing: de.custom.failure.

To turn on raising globally, you need to replace the default exception handler. The attached initializer makes I18n just raise any exception (in a development or test environment).

External content

Normalising Designs For Better Quality CSS

Awesome slide deck about taking liberties with design requirements in order to keep the CSS simple.

External content

4 Lessons Learned Doing Angular on Rails

We’ve been working on one of our first Angular projects with a Rails backend. It’s been a great experience. I wanted to share a few things we learned that we hope are helpful to others building Angular on Rails apps.

"cannot load such file -- nokogiri/nokogiri" (or any other Gem with native extensions on rvm and Ruby >= 2)

After running bundler / gem install I could not load nokogiri lately. It died with cannot load such file -- nokogiri/nokogiri.
This is not a problem of the gem but is due to a broken native extensions installation routine.

When installing nokogiri manually and with verbose output by using gem install -V nokogiri -v 1.5.6, you can see the problem scrolling by when the native extension is built:

/usr/bin//install -c -m 0755 /home/thomas/.rvm/gems/ruby-2.0.0-p247/gems/nokogiri-1.5.6/lib/home/thomas/.rvm/rubies/ruby-2.0.0-p...

Capybara: Trigger requests with custom request method

Preface: Normally, you would not need this in integrations tests (probably that's why it is so hard to achieve), because it is no actual "integration testing". If you use this step, know what you are doing.

Destroying a record with Capybara is not as easy as calling visit user_path(user, method: :delete), because RackTest's visit can only perform GET requests.

With this step you can destroy a records using either Selenium or RackTest. Ex…

External content

Parallel gem installing using Bundler

Bundler 1.4.0 (still beta) can install gems in parallel, making a run of bundle install much faster.

Getting rid of space between inline-block elements

When two elements with display: inline-block are sitting next to each other, whitespace between becomes a space character.

Solutions, in decreasing order of awesomeness:

  1. Don't have whitespace between two elements! See Whitespace Removal in Haml if you're using Haml.
  2. Don't use inline-block. Use floating elements instead (don't forget to clear them!).
  3. Try to compensate for the space with a negative margin. Unfortunately you will never be able to negate …
3447 cards