I can’t resist new stuff so I’m updating Genlighten to Rails 2.3.2. This release comes with some pretty sweet additions like Rack. Here’s what I had to do: Set RAILS_GEM_VERSION = ‘2.3.2’ (easy) Removed stuff like this from my code: protect_from_forgery :except => :swfupload session :cookie_only => false, :only => :swfupload </pre> — ‘The :digest…
Family Trip Day One
Day one of the annual Ball family trip is now complete. We started the day by taking a long time to pack as usual and yelling at the kids. The first stop was the train museum in Ogden at which point my son, who loves trains, nearly exploded. We had lunch at Adventure Cakes which…
Rubyforge and no configured for
I’ve been using jeweler to setup a new gem. I followed the instructions provided, but started getting “ configured for “ when I tried to do release my gem with “rake rubyforge:release”. It turns out that the rubyforge gem doesn’t quite configure everything for you. I added the following to ~/.rubyforge/autoconfig.yml and it started working:…
to_json gives TypeError Exception: wrong argument type Hash (expected Data)
Tonight for no apparent reason my tests started turning up this error whenever I tried to call to_json: TypeError Exception: wrong argument type Hash (expected Data) </pre> Specifically, my to_json call looked like this: respond_to do |format| format.js { render :json => @states.to_json(:only => [:id, :name]) } end </pre> In the debugger .to_json worked but…
Interesting testing issue with Rails 2.3.3
I’m not sure if this applies to all the versions of Rails, but right now I’m using the latest 2.3.3. I’m using shoulda to do testing and my code looks like this: context “GET show” do setup do @feed = Factory(:feed) get :show, :id => @feed.to_param end should_not_set_the_flash should_respond_with :success should_render_template :show end </pre> The…
jQuery.ajax – Get in Firefox, Post in Internet Explorer
The docs for jQuery.ajax indicate that by default the request is made using ‘GET’. I would still recommend setting the type to ‘GET’. We just deployed a site and found that for some reason some versions of Internet Explorer were doing a POST instead of a GET. This is problematic with a Ruby on Rails…
Implicit multipart emails using Ruby on Rails and ActionMailer won’t work
I’ve been beating my head against the wall trying to figure out why html emails from my Rails Engine are sent out as plain text ie the email shows up with all the html tags visible. Turns out there is an issue in Rails 2.3.2: https://rails.lighthouseapp.com/projects/8994/tickets/2263-rails-232-breaks-implicit-multipart-actionmailer-tests. For now I’m just setting my emails to html,…
Sending email with Ruby on Rails 2.3.2 and gmail
If you need an easy way to setup email for your company or for a client it’s hard to not love Google Apps. (The ‘standard’ ie free version is here). It is very likely that at some point you will need to send out emails from your application. Don’t cry. Gmail can do this for…
jeweler and the empty gemspec
I’ve been racking my brain trying to figure out why my gemspec for a new gem had no files in it. I’m using jeweler to build the gem and it’s worked great in the past. Then I read in the docs that jeweler will include any files in the gemspec that are not in .gitignore…
New Uploader Gem
I just pushed out a new uploader gem. Get the new code from github or install the gem with sudo gem install uploader. This comes with a few more translations and a fix for a nasty bug. The format was not properly set for uploads via swfupload. Unfortunately, even without the format it worked on…