Accessing a controller asynchronously usually requires writing a respond_to block in the corresponding action but I recently had the need to return a specific value in the same action based on the query string parameters.
Category: Notes (Page 47 of 50)
Notes on programming-related problems that I’ve encountered while working on various projects.
I’m in the process of building a Rails application and needed to introduce some autocomplete functionality on a couple of text fields.
If you’re using Rails 3 and are not working with jQuery and the jQuery UI library, then there is a solid gem you may want to checkout; otherwise, here’s how you can setup autocomplete on a text field using Rails 3, jQuery, and jQuery UI.
First, create the directory out of which you’ll be running your project. Ultimately, this is going to be the repository:
mkdir project_name
If you’re building out custom functionality or a plugin in WordPress, chances are you’re eventually going to need to get a permanent link to a post while outside of the loop.
In previous version of Rails, it was suggested that individual tests could be run like this:
ruby -Itest test unit/test/category_test.rb
Since Rails 3, I’ve been unsuccessful at actually being able to run tests that way. Specifically, the environment dumps out a few errors messages and fails to execute the tests.

