-
Filter chain halted as :find_page rendered or redirected in refinerycms
I ended up coming across this issue in Refinery CMS after switching databases. I had forgotten that I had swapped out databases because I had moved on to changing some other configuration bits in following the RailsCast for Refinery CMS. Fortunately, I found note on Refinery’s Getting Started page that deals with this: If you…
-
has_many :through, scoped to a value on the other side of the :through relationship
Here goes another round of wrapping my head around what rails associations are looking for. This time, I’m trying to scope a collection on the other side of a has_many :through to an attribute on that model. Contrived exhibit A: class Gym < ActiveRecord::Base # gym has a boolean "open" end class TrainerGym < ActiveRecord::Base…
-
Serving a file from your Rails app from another server protected by basic authentication
Interesting problem: Retrieve a document from one web service protected by basic auth (or some authentication mechanism) and serve it via a public link on another website. It ended up boiling down to this code in the controller (reduced to be in the same method instead of factored out as it was.) def get_download response…