When you encounter SSL errors when installing gems on Windows, the easiest workaround is to change your sources from https://… to http://…. But … I am an avid user/fan of rails-assets.org and today I suddenly started getting the error on their domain. So at first I feared that rails-assets had stopped as foreseen (in this […]
December 16, 2015 – 10:13 pm
In a project we built, we are using que for doing our background-jobs, and there is a very simple (but sufficient) and clean web-ui, called que-web, allowing us to monitor the status of the jobs online. And normally, you just include it in your project by adding the gem, and then adding the following to […]
April 29, 2014 – 10:50 am
Most of the times I use a config.yml to store application settings, that I want to be able to change quickly between environments, servers, deployments. But what with settings that need to be changed on the fly, by a user? I create a small model, with three fields. rails g model Setting name:string description:string value:string […]
November 9, 2012 – 6:38 pm
There are different reasons why a ActiveRecord::StaleObjectError would occur. Sometimes it is caused because rails does not have a stable identity map yet. This means that if the same object would be retrieved via different associations, your rails process would not know they point to the same object, would keep different copies of the same […]
I had an issue where I was not sure the ActiveRecord::SessionStore was actually working (in hindsight: it worked). But to make sure, I needed to know what was stored in the session or retrieved. Now all logging for the session-store is silenced, using Base.silence. Now I was very interested in that logging, and did not […]
October 28, 2011 – 8:31 pm
I normally do not do a lot of view specs, but at least I want to make sure that my view renders without errors. And sometimes I really need to make sure that some link is shown or hidden depending on e.g. the role of the user or linked objects. For example, So we check […]
October 11, 2011 – 10:26 am
For me, it started with a tweet from Uncle Bob Martin, saying that if all your domain logic is in your model, or if you put your domain logic inside your models by default, then you are doing it wrong. I think the reasoning behind this is that we should design the domain model before […]
I have created a few rails 3 sites, but i have never before ported an existing rails2 application to rails3. I will describe the problems i encountered. First off there were some very good resources (step-by-step descriptions) to guide me through it: the rails_upgrade plugin The asciicast (readable) upgrading to rails3 part 1 and part […]
Testing the view in Rspec is just great. It allows you to test the view in total isolation. It just does the render. Make sure you set up some data that is needed, and then check if all areas are available for instance. Now for Rspec2 a lot of things have changed: have_tag is no […]
Using git-submodule can make it very easy for you to work with plugins in your rails projects. I will try to show you this, in an easy step-by-step manner. To start, make a plugin-project, call it your_plugin, in its own folder, and push the code to git. Your standard commands apply, as for any project: […]