Categories
Updrift is the home of J. Wade Winningham. He helps make the web work.
Deploying a Rails app with Thinking Sphinx
Now that I’m using Thinking Sphinx I eventually had to deploy it. Since I didn’t find much info about deploying it using Capistrano here’s what I did to get deployments running smoothly.
How to get a good designer to do something within your budget
I overheard someone talking about not being able to find a designer to help them with a web project for less than a certain hourly rate. It’s not the hourly rate that matters, it’s the overall cost.
Here are some tips for getting a good designer to help you out regardless of cost:
- It’s who you know. You need to get out and meet with designers. In the Dallas area, Refresh Dallas is a good venue for this. Sometimes designers need development work, too, so maybe you can sync up on something. Especially if you’re around a big city, there will be a similar group.
- Better yet, work with good designers. If you do good work, they’ll remember and want to work with you more and give you some slack on price when you need it. They’ll recommend you to others, too.
- Tell them what you’ve got to spend up front. They’ll tell you what they can do. It’s possible all you need is a one page template and if you ask them to simply design a site, that typically entails much more effort. Some of the better designers I know ask for a budget outright so they know what they can offer within the constraints.
- If they can’t be of service, ask if they know anyone who could. Designers often know other designers.
Me on Tumblr
I’ve decided to setup a Tumblr page where I currently plan to post frequent, short things both professional and personal. Visit http://wadewinningham.tumblr.com.
Stay back, IE7!
Inevitably, today on my Windows XP notebook, the automatic update finally told me that it wanted to install IE7. Since I still need IE6 to test with and have IE7 working quite nicely on my MacBookPro in Parallels, I’m not going there.
Highscalability.com
http://highscalability.com has loads of useful information for creating very highly scalable sites. Includes a look behind the scenes of both Google and YouTube.
Putting Rails gems into the vendor directory
Over on Err The Blog is an article on placing your gems into the vendor directory rather than relying on them being in the environment.
I’ve run into the issue before where a Rails app doesn’t run on a server due to a gem not being installed. Adding them to your application seems like a perfect solution and deals with other computers possibly having various versions of gems installed.
Rails Hash Ordering
My expectation was that when I create a hash it’s going to act like a queue and be sorted in the order in which I inserted things. As I found out today, that is definitely not the case.
There is a very easy way that Rails offers to give a hash this behavior and it’s the OrderedHash function found in the ActiveSupport libraries.
my_hash = ActiveSupport::OrderedHash.new
After that initialization, your hash will be maintained in the order you insert things. Something to watch out for.
A couple of Ruby on Rails v1.2 gotchas
I recently upgraded a few projects to Rails v.1.2 and had a couple of issues arise.
Disappearing objects when dropped using drag and drop in Safari
For one project I use the drag and drop re-ordering provided by the Scriptaculous library. Not sure what did it, possibly even a Safari update, but only in Safari, once you let go of a dragged object, that object would disappear. It would come back when you refreshed the page and would have successfully triggered its intended action.
I did update my javascript files upon upgrading to v.1.2.1, but had not upon the upgrade to v1.2.2 since I wasn’t aware of any changes. I think the release of Scriptaculous on its actual site is newer (v1.7 right now) than that included in Rails so I updated my scripts and that solved the problem.
Model attributes not in the database were inaccessible
I wasn’t able to figure this one out, but was able to get around it. I have a model which has some methods to send/receive messages to a device. I had a
attr_accessor :last_response
which is an attribute that’s not in the database. It was simple a place to temporarily store the full message of the last response for use later on in the code. After the upgrade to v1.2.1 things were fine. However after updating to v.1.2.2, I started getting “Method not defined” errors. It seems like other people have hit this one, too.
My solution was simply to remove the property and change it to @last_response which worked for my limited use of it.
I’m still scratching my head though, since similar attributes work fine in other classes. The problem class, however, is unique in that instead of having ActiveRecord:Base as its parent, the actual parent is a generic class whose parent is ActiveRecord:Base.



