Posts tagged Rails

Jun01

Presentation: an audience perspective

rails railsconf railsconf08 RailsConf RailsConf ‘08 Rails | comments

HTML parse error: 
<div class="flair">
  <img src="http://farm3.static.flickr.com/2032/2541589315_d20f683b6c_m_d.jpg" width="240" height="180" alt="Baked NYC" /><br />
  <div class="text-backing">&nbsp;</div>
  <div class="text">Photo by <a href="http://www.flickr.com/photos/peterhellberg/">Peter Hellberg</a></div>
Continue reading »

May28

RailsConf '08

rails railsconf railsconf08 RailsConf RailsConf '08 | comments

Just wanted to drop a note in my blog, here, that I will be attending RailsConf from Friday through Sunday. If any lurkers out there are gonna be in attendance, do drop me a note. Let’s meet each other!

Continue reading »

Mar31

A Rails way to track additional schema info

Rails ActiveRecord | comments

HTML parse error: 
<div class="flair">
  <img src="http://farm1.static.flickr.com/28/60990379_d52dd11d69_m_d.jpg" width="240" height="180" alt="Baked NYC" /><br />
  <div class="text-backing">&nbsp;</div>
  <div class="text">Photo by <a href="http://www.flickr.com/photos/progoddess/">rachel is ...</a></div>
Continue reading »

Mar29

ActiveResource HTTP basic auth with email address

ActiveResource Rails authorization | comments

As I’ve started to play around here and there with ActiveResource, I’ve noticed lots of complaints about how ActiveResource’s implementation of HTTP basic auth leaves a lot to be desired. Specifically with regard to its lack of support for email addresses as usernames. This won’t work:

Continue reading »

Feb28

Move server configuration files into your repository

capistrano rails ruby scm svn Ruby Rails SVN SCM Capistrano | comments

HTML parse error: 
<div class="flair">
  <img src="http://farm1.static.flickr.com/45/139177165_e3855c6686_m_d.jpg" width="240" height="180" alt="Dung repository" /><br />
  <div class="text-backing">&nbsp;</div>
  <div class="text">Photo by <a href="http://flickr.com/photos/cheesygarlicboy/">Chambo25</a></div>
Continue reading »

Jan02

Integrating Rails and WordPress

WordPress Ruby on Rails | comments

HTML parse error: 
<div class="flair">
  <img src="http://farm1.static.flickr.com/4/9183721_1ec8cf6ef4_m.jpg" width="240" height="180" alt="Mad code rewrite" /><br />
  <div class="text-backing"> </div>
  <div class="text">Photo by <a href="http://flickr.com/photos/zhartley/">zhartley</a></div>
Continue reading »

Nov28

Rails before_destroy gotcha

Ruby Rails programming | comments

So there’s a Category that has many Expenses. The expenses for a category are destroyed when the category is destroyed. Elsewhere in my logic I would like to know if the category is removable based on whether it has any expenses and, if it does, whether any of the expenses it has are greater than zero.

Continue reading »

Nov12

A Rails way to popup secondary windows

Ruby Rails JavaScript | comments

I had to solve a hairy problem recently. For a select number of pages on a site, I needed to pop up a secondary window along with the current action. This window contained a request for filling out a survey (held at a third party site). The survey URL was variable depending on the page I arrived at.

Continue reading »

Oct22

Ruby console spacebar problems

Ruby Rails irb script/console readline spacebar problem | comments

Since early this summer, I have had a severely annoying problem with my Ruby consoles (irb and script/console). My spacebar quit functioning, making quick testing of Ruby and Rails functionality quite limited and in some cases impossible. I’ll give you two versions of my story. First the short version.

Continue reading »

Oct15

When single-table inheritance attacks

Rails Ruby single-table inheritance STI | comments

HTML parse error: 
<div class="flair">
  <img src="http://farm1.static.flickr.com/31/46196140_010d9aeff9_m.jpg" width="240" height="180" alt="Broken Ping-Pong Table" /><br />
  <div class="text-backing"> </div>
  <div class="text">Photo by <a href="http://flickr.com/photos/darlingsnail/">DarlingSnail</a></div>
Continue reading »

Oct08

has_many_polymorphs and checkboxes

Rails Ruby has_many_polymorphs | comments

Previously I discussed getting my feet wet with has_many_polymorphs. In that article I promised a follow-up dealing with checkboxes in a polymorphic world. As I started keying the article, I ran into a much better description of the overall issue by Dylan Fareed (I presume) at I Am Still Alive. Take a look at his has_many_polymorphs overview.

Continue reading »

Oct01

A model diagram for your Rails application

Ruby on Rails Rails model visualization data diagram class visualization class diagram Ruby on Rails Rails model visualization data diagram class visualization class diagram | comments

HTML parse error: 
<div class="flair">
  <img src="http://farm1.static.flickr.com/218/507682952_8b4eda2922_m.jpg" width="240" height="160" alt="51907_35.jpg" /><br />
  <div class="text-backing">&nbsp;</div>
  <div class="text">Photo by <a href="http://flickr.com/photos/always13/">always13</a></div>
Continue reading »

Sep19

My foray into has_many_polymorphs

Rails has_many_polymorphs Rails | comments

The great thing about my worklife as of late is seemingly every week I get to learn something new. I don’t necessarily have to learn something new, but I certainly want to. My base of experience is growing and I’m arriving at a place where I can recognize when the unknown thing will likely be worth learning to create a more elegant solution. Thankfully I work with people who have a similar grasp on reality.

Continue reading »

Sep12

Rails auto select text field tag

Ruby on Rails Rails Ruby on Rails Rails | comments

On a recent project, I needed to simulate the YouTube-ish text field selection box. You know the one where you can easily select and copy a link or embed code to send on to your friends. You click in the box, the text is automatically selected, and you can quickly copy the text.

Continue reading »

Sep05

TextMate find in project slow in Rails

TextMate Rails Ruby on Rails TextMate Rails Ruby on Rails | comments

Update: Don’t bother with the crap I spewed below. Just head over to Rail Spikes. There are a couple options if you read the post and comments.

Continue reading »

Aug29

Adding a mongrel instance to a Slicehost Rails app

Ruby on Rails mongrel Slicehost Ruby on Rails mongrel Slicehost | comments

HTML parse error: 
<div class="flair">
  <img src="http://farm1.static.flickr.com/204/524123975_bed8ab7cbb_m.jpg" width="240" height="160" alt="Cindy" /><br />
  <div class="text-backing">&nbsp;</div>
  <div class="text">Photo by <a href="http://flickr.com/photos/georgiap/r">caribbean</a></div>
Continue reading »

Aug27

Make sure to properly scope your Ruby mixins

Ruby on Rails Ruby Rails Ruby on Rails Ruby Rails | comments

HTML parse error: 
<div class="flair">
  <img src="http://farm2.static.flickr.com/1012/1025919868_ebf0df1a71_m.jpg" width="240" height="160" alt="Matt - rifle" /><br />
  <div class="text-backing">&nbsp;</div>
  <div class="text">Photo by <a href="http://flickr.com/photos/amagill/">AMagill</a></div>
Continue reading »

Aug06

Rails maintenance page with images and styles

Ruby on Rails Apache Ruby on Rails Apache | comments

Recently I implemented a true maintenance page on Scrawlers using Mike Clark’s excellent HOWTO. Clark’s directions show you how to create a more dynamic maintenance page than the standard HTML version we all know and love. It’s a good technique.

Continue reading »

Aug01

Rolling your Rails logs with logrotate

logrotate Rails logrotate Rails | comments

Now that I’m managing Scrawlers’ server, I have the power to use a more appropriate Rails log rotation technique than I was allowed at Dreamhost. Specifically, I can use logrotate on my Ubuntu Slicehost slice.

Continue reading »

Jul30

Don't forget the return value on Rails callbacks

Ruby on Rails programming Ruby on Rails programming | comments

This morning I spent a good while hashing on a problem in some new code I’m updating for a freelance project. I added a couple callbacks to an ActiveRecord model, and things that previously worked were broken. Unfortunately there were no errors in the model or exceptions in the system to give me a hint as to what went wrong. When I finally uncovered the problem, I was thankful that it was something I had never run into before.

Continue reading »

Jul25

Stubbing objects in Radiant

Radiant Rails Radiant Rails | comments

On a recent Radiant customization project, I needed to write some tests for a front-end extension. One situation called for a stub object, so I built out the pathing and created the stub object as I’m used to doing in Rails. In extensions/extension_name/test/mocks/test I created a some_mailer.rb object to mock a mailer model, overriding the mailer’s deliver_mail method:

Continue reading »

Mar09

Clear Rails sessions on Dreamhost

Rails Dreamhost Rails Dreamhost | comments

Following the advice of the Agile Web Development with Rails book, I sought to clear out sessions periodically from the Scrawlers database. I also took a hint from RealityForge.org and put the work directly in Rails, using script/runner to execute. Specifically I created a new model class: SessionCleaner (/app/models/session_cleaner.rb).

Continue reading »