package playne

imports "programmer"

Tag: Ruby

  • rails generate Could not find <gem> in any of the sources

    So with my latest project I am using Rails 4.1 – this is all well and good, but here is a gotcha. there is a thing called spring that is supposed to make things faster – except when it gets in the way! tl;dr – killall spring So – here are the symptoms $ rails…

  • Rails, CanCan and Best In Place editing

    So here is a little gotcha and solution when using CanCan and Best In Place. With the default setup, if CanCan auth fails on a best in place edit you get a redirect to your default “Auth Failed” path and that page then tries to render as javascript. that does not work all that well!…

  • has_many :through and the case of the missing include

    tl;dr – you need to specify the “inverse_of” option on your has_many/belongs_to relationship to get your children fully populated So I came across an interesting situation the other day, where my includes() statement was preloading data, but then when accessing it I would see another SQL query. require ‘active_record’ class Parent < ActiveRecord::Base attr_accessible :name…