Tiptip is a nice jquery plugin for displaying tooltips in a simple and elegant manner. All you need to do is set the title attribute with the tooltip content then give it a class name so it it picked up by the tooltip initializer.
However, it currently doesnt work in IE6 that well. Although users are falling I think you still need at least rudimentary support for IE6.
Create a conditional comment which includes a stylesheet load in your document header.
I have been working on a google base product search xml feed generator. It is in the form of a semi-customizable rake task. I have released this as a kind of rails plugin.
rake googlebase:generate generates an xml file of your products.
Configuration
To configure, add Rails.root/config/google_base.yml
Example google_base.yml file in files/google_base.yml
As the structure of the xml is dependant on your product models I have left it to the programmer to modify the google.rake file and set the correct instance methods for returning product information, along with the named_scope for returning live products.
TODO:
Instead of editing this rake file manually it would be good to add a plugin type class method which can take the configuration of your products and generate this automatically.
When doing functional testing of ajax actions it is nice to be able to test the format of the javascript returned to the browser.
When using rjs I was using the excellent arts testing library, now I have moved to raw jquery instead. The method below provides a short hand way to test simple jquery methods. it can be built upon for sure but this little regex is quite powerful.
def assert_jquery(effect, id)
assert_match(/\$\(['"]+##{id}['"]+\).#{effect}\(.*\);/, @response.body)
end
Consider the jquery
$("#announcement").hide();
assert_jquery('hide', 'announcement')
This currently only works for id methods and when jquery isnt in compatibility mode. Also integration testing using something like env.js and harmony is a better way of javascript testing. Things like blue ridge actually integrate the env.js framework into a rails plugin and are a great solution if you have to do some real heavy lifting.
However, this method brings maximum results for minimum effort.
I think this could me my first php blog post ever! I am normally so excited about ruby and related technologies that my involvement with php has wained over recent years.
I think this is a good thing as I can now see that PHP is not as good as its Python and Ruby colleagues. However, recently I have been unable to choose technology and have been working on a number of php projects at work.
Using textmate as my weapon of choice (instead of eclipse based IDEs which are more common) I have come to use the ruby code beautifier bundle a lot when crafting elite ruby code.
I have put together a code beautifier bundle for textmate which makes dirty php code look prettier.
The actual beautifier php class was modified from the original . This is a relatively crude beautifier and could do with some fine tuning to improve a few annoyances. If you feel like helping please fork the project on github and give me a pull request.
I have written a number of rails applications over the past few years. While new projects are using rails 2.3 I have a number of older applications which I should have upgraded before but havent. Anyway, here is some little notes to take into account when upgrading to rails 2.3. Then from here you are placed well for the upcoming release of rails 3.
to_param method issues (fixnum to string)
test_helper modifications – class name (ActiveSupport::TestCase and all unit tests need to extend this)
add include ActionController::TestProcess to test_helper.rb
to silence spec warnings for old unpacked gems – Rails::VendorGemSourceIndex.silence_spec_warnings = true