How to setup SyntaxHighlighter in Rails 3.1.1
Posted by Jim Morris on Sat Nov 12 01:36:29 -0800 2011
Or how to get Rails 3.1.1 assets in vendor/assets
to work in
production.
Posted by Jim Morris on Sat Nov 12 01:36:29 -0800 2011
Or how to get Rails 3.1.1 assets in vendor/assets
to work in
production.
Posted by Jim Morris on Sat Dec 18 01:04:06 -0800 2010
This one does not seem to be documented, and I just got bit.
After porting my
blog engine to Rails
3, I noticed that after a while comments were being rejected with an
ActionController::InvalidAuthenticityToken
error.
Posted by Jim Morris on Fri Dec 17 15:27:17 -0800 2010
After porting my blog engine from Merb to Rails3 code here I thought I'd upgrade my Snow Dogs R Us Site (aka dogz.us) to Rails 3.
It was written in Rails 2.2.2 so I figured it would not be too hard, well it was easier to port my Merb App than it was my Rails app!
... Show more ...Posted by Jim Morris on Mon Nov 29 23:06:41 -0800 2010
UPDATE the following is for pre rails 3.1, there is an addendum at the end for rails 3.1+
I have ported my blog engine (that hosts this site), from Merb to Rails 3. You would expect it to be fairly simple as Rails 3 is meant to be the next version of Merb.
... Show more ...Posted by Jim Morris on Fri Feb 06 15:04:54 -0800 2009
There is a raging debate in many forums about how to do fixture-like things. Basically how do you populate a database with test data so you can run your Specs/Tests/Features.
There are several libraries out there to do this like FactoryGirl, FixtureReplacement, Machinist, Fixjour etc etc. If you use Rails and ActiveRecord pick the one you like and be happy ;)
... Show more ...Posted by Jim Morris on Wed Jan 02 13:32:50 -0800 2008
I've been working on a project that is mostly Java for the last many months, so haven't had much Ruby or Rails stuff to share.
However one thing I found when working on my tests in Java was an xpath matcher for JUnit 4.0 using the Hamcrest libraries.
... Show more ...Posted by Jim Morris on Tue Aug 07 23:53:09 -0700 2007
In my latest web project I potentially have a lot of boolean preferences, which I use for enabling or disabling various email notifications to users.
Rather than having to add a migration everytime I want to add a new
preference, I thought I would use the composed_of
feature in my model
and compose the boolean preferences from a bitvector. That way I can
simply modify my model to add new preferences rather than add new
columns to the database.
Posted by Jim Morris on Mon Jul 30 15:04:50 -0700 2007
A question I see asked a lot is how do I paginate acts_as_taggable (on steroids)?
I haven't seen any answers I liked, so I created my own, which I'm sure a few people won't like either ;) But it works for me (tm).
... Show more ...Posted by Jim Morris on Sat Jul 28 14:23:07 -0700 2007
A pattern I find very helpful is to find all the actions in a controller and apply a test to all those actions.
For instance this is useful for automatically testing all actions are protected from unauthorized access when using a login system.
... Show more ...Posted by Jim Morris on Sat Jul 14 16:44:33 -0700 2007
UPDATED for HAML 2.0 and RSpec 1.1.5 - Changed open to haml_tag, prefix helper. to all rspec calls...
The most recent release of HAML introduced a neat feature that allows you to use HAML-like syntax in your helpers to generate HTML HAML#haml_tag.
... Show more ...