I decided to try out the latest edge Rails and I started getting this error:
!!! The bundled mysql.rb driver has been removed from Rails 2.2. Please install the mysql gem and try again: gem install mysql.
/!\ FAILSAFE /!\ Mon Jul 28 22:58:38 -0600 2008
Status: 500 Internal Server Error
dlopen(/Library/Ruby/Gems/1.8/gems/mysql-2.7/lib/mysql.bundle, 9): Library [...]
Tags: gems · mysql · Ruby On Rails
If you are using the acts_as_state_machine plugin to manage the state of your object keep this in mind:
If you are going to have an object like an order or something similar that likely has a field state_id to relate in a geographic state then you need to be sure to rename the column that acts_as_state_machine [...]
Tags: acts_as_state_machine · bugs · Ruby On Rails
One of the models in a project I am working on right now ends in ’status’. Rails handles that just find but in my tests I started noticing an odd error:
test: Lookup should belong_to lookup_status. (LookupTest):
NameError: uninitialized constant LookupStatu
The Shoulda test looks like this:
should_belong_to :lookup_status
Nothing to complicated there. Should recognizes [...]
Tags: bugs · Ruby On Rails · shoulda
I have been banging my head against a problem in my testing. Using the UI everything worked as expected, but my tests were failing when I tried to see if emails were being sent in a specific case.
Here’s the test I was trying to run using Shoulda:
context “reset password for user that has not [...]
Tags: assert_sent_email · Ruby On Rails · shoulda
Shoulda comes with a great method for testing email called ‘assert_sent_email’. (If you try it and get a method missing error update Shoulda. Not that anyone wouldn’t know to just do that). No matter what you use to test email as long as you are in test mode your emails will be [...]
Tags: assert_sent_email · email · Ruby On Rails · shoulda
We have to do an integration with Saleforce for a Rails project we are working on. I keep getting this error:
The :dependent option expects either :destroy or :delete (:nullify)
I posted to the Salesforce forums and didn’t get any response so I did some more investigation. Turns out there is a bug and a [...]
Tags: activesalesforce · bugs · helps · Ruby On Rails · Salesforce · tips
Checkboxes are one of those things that look easy and should be easy, but they aren’t always easy. I needed a solution that could create a checkbox list of languages that a user speaks. So I don’t forget here’s how to do it:
The migrations are important. You have to be sure [...]
Tags: checkbox list · checkboxes · HABTM · has and belongs to many · Ruby On Rails
Last year for our open ed conference here at Utah State I built an application called 51weeks to help preserve the presentations and to help people interact. Tomorrow it will be used at ICLS in the Netherlands. The hardest part about these kinds of applications is life cycle management. I am frequently [...]
Tags: 51weeks · icls2008 · Ruby On Rails
I want to be cool like everyone else so I use a REST methodology for most of my Rails controllers these days. I wasn’t ever quite sure how my views managed to maintain values for a given object (User, Post, etc) after a failed call to create that that did a render :action => [...]
Tags: render · Ruby On Rails
jQuery is the hot javascript library and it is small and it is cooler than Prototype, the default library that comes with Ruby on Rails. Ergo I plugged it in and pulled out everything else. The ajax calls are very simple and look like this:
$.post(”function_name”,{ key:value } ,function(data)
{
[...]
Tags: ajax · InvalidAuthenticityToken · jQuery · Ruby On Rails