Ask for Help
“Paperclip and fixture builder – we’re getting some strange errors that for some reason are fixed when you rerun fixture builder – any ideas?”
No one has run into this specifically, but a few people said to make sure you’re mocking out Paperclip.
“Fakeweb, Webmock, VCR, artifice – what’s a good Ruby/Rails developer to use?”
It was mentioned that Artifice is good for Selenium tests while Fakeweb and Webmock are good for rSpec tests. VCR’s got some fans as well. Sounds like you can’t go all that wrong whatever you choose.
GoGaRuCo – This year it will be September 16th & 17th. A call for proposals will be going out sometime in the near future.
Unicorn – it turns out that Unicorn doesn’t reopen logs after a log rotation unless the path to the log in Unicorn is absolute – so don’t use relative paths!
Get your Rails mentoring on at RailsBridge this April 8th & 9th @ the Modcloth offices in downtown SF. It’s very rewarding.
If you have nested_attributes updating an attribute that is NOT in your attr_accessible attribute list on your ActiveRecord model you won’t get an exception – it will just silently fail. It will, however, output a warning line to your Rails log file. Fun for the whole family.
Using popen to open a process actually calls ‘sh -c’ to open your process, so the process you just ran is actually the child of the ‘sh -c’ process you just ran. This makes tracking down PIDs simply wonderful. :-) You can use ‘exec’ instead and your process will be the parent process. But if you’re using the new hotness you can instead use Process.spawn in Ruby 1.9.
Adam wanted an easy command to run during deployment to get the remote master SHA1 of a git submodule.
The command he was interested in was:
git show origin master -- vendor/your-submodule-here
Josh mentioned that Capybara has a new DSL that makes steak unneeded. There’s a good post here on how to get started with it.
Ask for Help
We have an html table with rows that correspond to
database rows. We’d like an easy way to implement per- > row editing of this data, but <TR>s are not happy to be
wrapped in a <FORM>. How fix?
- Backbone.js has the ability to link html elements to server-backed data models, might be handy here
- put forms around individual <TBODY> elements for the individual rows
We’re using ActiveResource as a foundation for our API client, but it doesn’t process JSON errors correctly. How fix?
This has been in the issues tracker for ActiveResource for over a year and is marked low priority. HttpParty was suggested as an alternative, anyone else have something they like?
Some folks are using HTML5 Canvas and are taking IE9′s canvas support for a spin. Turns out that if you apply some font settings to text on a canvas and then rotate it, IE9 will actually shift the center point of the text, creating a surprising jump, diagonal in this case. If you don’t want your text to hopscotch across the page, you have to rotate it first, then apply the font.
Webrat used with selenium doesn’t follow redirects with Rails 2.3 on Mongrel. One team used thin instead of mongrel, which solves this problem. Using webrat with thin requires a patch
Ask for Help
“Is there a better way to work on a feature, set that feature set aside, do a small change, check that small change in, then resume work on the feature, all using Git?”
git stash was originally used. There were also suggestions to use a feature branch or use one of the Git GUI tools (gitx, tower, smartgit, gitti) that let you partially stage your changes then check in. Or git-friendly workflow scripts or the ol’ reliable git cherry-pick.
Turns out there’s a hidden “feature” in jQuery’s .animate method. If your starting point for an animation is less than -10,000 px, it sets it to 0. Meaning your -10000 to -12000 animation is going to move a surprising 12000 pixels. There, fixed that for ya!
The -10,000px limit is hard-coded deep in the jQuery animate code, we speculate that it may resolve an issue in one browser or another. So before you start creating Ken Burns-style photo pans with your gigapixel images, make sure you have a plan to dodge this limit.
We’re committed to providing clients with license information for all the libraries we use on each project. To that end, some Pivots have created LicenseFinder, a command line tool which scans your project for Rubygems and summarizes the license data it can recognize. It’s recently had some upgrades. [Check it out].(https://github.com/pivotal/LicenseFinder)
“Chrome 11 + Webdriver + Java applets – Chrome 11 has changed the always allow Java plugins setting so that it is no longer global, and must be allowed for each applet. When running tests, Webdriver deletes the profile that stores this setting after each test run, causing specs to fail since a new dialog asking whether to allow the plugin pops up every time. Any ideas?”
The current fix seems to be to downgrade to Chrome 10.
“Does anyone know why using Spork + the ruby debugger just outputs ‘disconnected’ and doesn’t break at any breakpoints?”
The general consensus is to run tests on Spork and print out Spork when you want to debug.
- You should try Spork if you’re using Rails 3 and your tests are running slowly.
autofocus attribute +
hover css rule in WebKit may not play nicely with each other