Godbit Is A Blast
March 13th, 2007
I had a really great time last night at the Godbit dinner. We had 30 people there – what a great turnout! Thanks to everyone who came!
TGI Friday’s is a good location for this sort of thing. It was a bit crowded at the table, but the location can’t be beat. We even got to watch the bats at the Congress Avenue Bridge.
I hope this doesn’t sound too sappy, but I feel really privileged to be in association with you guys and gals. The Godbit crew is a fantastic group of professionals and just plain good people.
SXSW Godbit Dinner Upcoming
March 9th, 2007
It’s just about time for the 2nd Annual SXSW Godbit Get-together! If you’re in Austin for SXSW or just in Austin, come on by TGI Friday’s on Sunday night. TGIF is literally right down the street from the convention center, so you should have no excuse to miss out. Come meet me and 15-20 other Godbit folk as we de-lurk and meet each other in person.
Oh, if you plan to come by, please let me know by signing up on the Upcoming.org page. That way I can let the restaurant know how many to expect.
And as Nathan Smith said:
Please note that you do not necessarily have to be a registered attendee at SXSW to come to the Godbit dinner. We simply plan the dinner around the conference because it seems to gather a large geek following. Plus, we did it last year so now it’s tradition! Come one, come all – and bring a friend.
The Upcoming.org page:
http://upcoming.org/event/151915
The Godbit forum thread:
http://godbit.com/forum/viewtopic.php?pid=13721
The article on Godbit.com:
http://godbit.com/article/godbit-dinner-07
When: Sunday, March 12, 2007
Where:
TGI Friday’s –
111 Cesar Chavez St E
Austin, Texas 78701
Easy Printable Pages with Rails
March 5th, 2007
Print-friendly pages require either code forking or magic tricks with CSS, right? Not with Rails. You barely have to modify your code to make this work. You will need to be using Rails’ web service support with respond_to blocks.
Fun part first. Just add a line to your respond_to block, like this:
1 2 3 4 |
respond_to do |format| format.html format.print { render :layout => "print" } end |
Next, you’ll need a layout for your print-friendly page. Create a new layout called print.rhtml
, and create the associated print stylesheet(s). I’ll wait while you do that.
Now you’ll need to add a mime type for the print format. You can register a new mime type with your server. But a quicker way to do this is to add this line to your environment.rb
file:
|
Mime::Type.register "text/html", :print |
Make sure to restart your application so that the mime type is actually loaded.
Now the money shot – add a link to your new print-friendly page:
|
<%= link_to "Print this", {:format => "print"} %> |
That’s it! No code forking, nothing too hard, and easy to maintain. And to top it all off, you get neat looking URLs like www.example.com/pages/123.print
.
Speed up Tests with SQLite3 in Memory
March 3rd, 2007
Did you know you can use a memory-based database to run your Rails tests? Compared to running tests against a regular database (PostgreSQL, MySQL, or SQLite), it’s much, much faster.
You’ll need SQLite (http://www.sqlite.org/, http://wiki.rubyonrails.org/rails/pages/HowtoUseSQLite) and the MemoryTestFix plugin (http://topfunky.net/svn/plugins/memory_test_fix/) from Geoffrey Grosenbach.
The instructions given are great, except if you use SQLite3, like me. If you do, you’ll need to make a small tweak to the memory_test_fix.rb
file. On line 4, Simply change SQLiteAdapter
to SQLite3Adapter
. That’s it! Enjoy faster tests!
Linkage
- http://nubyonrails.topfunky.com/articles/2006/06/01/san-francisco-sqlite3-memory-tests-asteroids
- http://blog.seagul.co.uk/articles/2006/02/08/in-memory-sqlite-database-for-rails-testing
- http://topfunky.net/svn/plugins/memory_test_fix/
- http://www.sqlite.org/
- http://wiki.rubyonrails.org/rails/pages/HowtoUseSQLite
Subscribe
Network
Archives
- July 2009 (1)
- May 2009 (4)
- March 2009 (1)
- February 2009 (1)
- December 2008 (2)
- November 2008 (1)
- October 2008 (7)
- September 2008 (4)
- August 2008 (4)
- June 2008 (2)
- April 2008 (1)
- March 2008 (1)
- February 2008 (5)
- January 2008 (1)
- December 2007 (1)
- November 2007 (4)
- October 2007 (1)
- September 2007 (1)
- August 2007 (3)
- July 2007 (2)
- June 2007 (5)
- May 2007 (6)
- April 2007 (3)
- March 2007 (4)
- February 2007 (5)
- January 2007 (5)
- December 2006 (6)
- November 2006 (1)
- October 2006 (8)
- September 2006 (12)
- August 2006 (7)
- July 2006 (6)
- June 2006 (6)
- May 2006 (2)
- April 2006 (17)
- March 2006 (15)
- February 2006 (7)
- January 2006 (12)
- December 2005 (25)
- November 2005 (11)
- October 2005 (3)
- September 2005 (2)
- August 2005 (4)
- July 2005 (5)
- June 2005 (1)