Erik Hanson's blog
Ask for Help
"
window.onhashchangedoesn't work in Android's version of WebKit?"
The event exists, but it doesn't ever get fired. Apparently this also happens in Mobile Safari. Does anyone know how to get it to work?
"What's the latest and greatest replacement for acts_as_list?"
Apparently there's no fabulous replacement for acts_as_list.
Interesting Things
- Apigee to-go will make an API console for your site.
- Ruby Gems 1.6.1 is out.
Ask for Help
"'Teamcity formatter missing' error?"
Any ideas how to work around a "Teamcity formatter error" message when running specs (using RSpec 2) in RubyMine?
" Paperclip breaks when a filename contains a '#' character"
Apparently this has been fixed but not released?
Interesting Things
Selenium Conference is taking place in San Francisco on April 4-6.
MongoDB apparently stores pre-epoch dates as far-future dates and converts them back from future to past dates automatically. However, it does not convert them when searching or sorting.
Ask for Help
"Has anyone else had their Selenium tests break after upgrading from rails 2.3.8 to 2.3.11?"
One team was using Rack 1.1.0, Mongrel 1.1.5 and Rails 2.3.8. When they upgraded to Rails 2.3.11, their Selenium tests started failing. After some investigation they found this commit which they used to create a monkeypatch for Rack 1.1.0:
# Back-porting this patch: https://github.com/rack/rack/commit/f6f3c60938ea3b08f3292a2480e6753c293584e5
module Rack
module Utils
class HeaderHash < Hash
def [](k)
super(@names[k]) if @names[k]
super(@names[k.downcase])
end
end
end
end
Anyone have a better solution?
"Slower test suite with Spork?"
Spork can speed up the start-up time of your test suite, but has anyone seen it slow down the overall test run? One Pivot was seeing a 10% slowdown in overall suite speed.
Interesting Things
- Postgres can write a lot of stuff to your logs. You can quiet it down with the silent-postgres gem and by adding min_messages to database.yml
- RubyMine 3.1 has support for Spork!
Ask for Help
"jQuery throwing a syntax error when using
is("[data-foo]")?"
Has anyone seen jQuery throw a syntax error when passing a data- attribute name to the is() function? This code often works, but started throwing a syntax error after some markup was removed and then re-inserted into the DOM:
$("#foo").attr("data-bar") = 5;
$("#foo").is("[data-bar]");
Interesting Things
- Rails 3.0.5 has been released.
- The Nordic Ruby Conference call for proposals ends today, so hurry up and submit.
- Rails Conf 2011, which is being held in my hometown of Bal-ti-more, just announced its keynote speakers. Check them out.
Ask for Help
Exceptions thrown in Rails views get wrapped by
ActionView::TemplateErrorwhich makes rescuing specific exceptions hard
It's probably best to prepare all your data in your controller or models and not in the view, which will obviate this and other problems.
Ask for Help
Does anyone have suggestions for an off-the-shelf data reporting tool to help display some data in a webapp for internal users to see?
form.submit() vs. <form onsubmit="...">: An
onsubmitattribute added to aformelement doesn't get called whenform.submit()is called from Javascript.
- Try using Javascript to attach an onsubmit handler rather than adding it as an attribute of the
formelement. - Instead of calling
form.submit()from Javascript, send a click event to a hiddensubmitbutton.
Timezones are being ignored when a date is passed into ActiveRecord's
findmethod, but are not ignored when passed into other methods.
This seems to be due to a bug in ActiveSupport's to_s(:db). One solution is to override to_s and fix the time zone.
Interesting Things
When trying to create an ssh tunnel to EngineYard, set
GatewayPortstoyesinsshd, otherwise the tunnel won't bind to your local computer.WAVE Toolbar (Web accessiblity evaluation tool) is a great Firefox extension that shows you which parts of your pages have accessibility issues.
The next meeting of the San Francisco Pivotal Tracker Users Group is tonight at 6:30 PM at the Pivotal Labs headquaters on Market St.
Interesting Things
- git-wtf is a useful script for showing the state of your git repo. It was mentioned specifically for its ability to show you the details about the commits you haven't yet pushed (especially if there have been multiple commits by other people in the meantime).
Interesting Things
- Shotgun is an automatic reloading version of the rackup command that's shipped with Rack.
Interesting Things
The Golden Gate Ruby Conference is now accepting proposals for talks.
Rails by default stores its session in a browser cookie as an encrypted string. If you want to get the contents of that cookie from within Rails, you can call "
session.dbman.send :marshal, session.data". If you want to get that value from tests, you'll have to use an integration test, as functional tests mock out too much of the session store.
Ask for Help
- "Can anyone recommend a tool to help find cross-site scripting (XSS) vulnerabilities?" One suggestion was Wikto.
