jsTree: adding Expand All and Collapse All buttons

The documentation for jsTree is thorough, but not particularly easy to read. If you are looking for an easy way to add “Expand All” and “Collapse All” buttons, here’s one way: <input type=”button” value=”Collapse All” onclick=”$(‘#tree_container_id’).jstree(‘close_all’);”> <input type=”button” value=”Expand All” onclick=”$(‘#tree_container_id’).jstree(‘open_all’);”> where ‘#tree_container_id’ is, of course, the ID of the container node for your tree.

Uploadify: changing scriptData with dropdowns

Uploadify is a pretty awesome jQuery/flash uploader. It’s made even more awesome by the stuff you can do with it on the fly. For example, if you want to pass a variable chosen from a dropdown via the uploader, you can use uploadifySettings() to do so. Some people appear to have problems with this part, … [Read more…]

Testing CKEditor in Ruby on Rails with Cucumber/Capybara

I have a textarea with the id of “request_details”, made into a CKEditor instance by jQuery: $(‘#request_details’).ckeditor(); (Check this page if you need some help getting CKEditor to work with jQuery, it’s dead simple) Feature looks like this:  And I fill in “Here are some details” in the CKEditor instance “request_details” Step looks like this: … [Read more…]

My least favorite phrase

I’ve decided on my least favorite phrase in the English language: “Can’t you just…?” Why is this my least favorite phrase? Because: It’s always in conjunction with a task that the questioner does not understand, but assumes should not be difficult at all; it is inherently second-guessing the person being asked, which is insulting; and, … [Read more…]

Using mysql2 on Windows

Another edition of Sara uses Rails on Windows! *muppety fanfare* Trying to get mysql2 to run on Windows is a bit of a pain. I used the lovely installer from Railsinstaller.org and then created an app with : rails new testapp -d mysql and then bundled. By default this installs the mysql2 gem. There are … [Read more…]

Github, https, and you

Banged my head against this for a while. Starting a new rails project, trying to get rails.js from github, but it’s failing every time: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (OpenSSL::SSL::SSLError) So (after a lot of googling) I opened up gems/jquery-rails-0.2.7/lib/generators/jquery/install/install_generator.rb and added this just after the beginning of the … [Read more…]

Pik and Git Bash on Windows 7

Lately I’ve been installing Ruby on Rails on Windows 7, and have run into a few people trying to make my life easier. One is Sarah Mei, a wonderful member of devchix who has posted a guide for getting things running.  Hearts and bunnies and flowers for her. Pik is a neat project for Windows … [Read more…]

ImageMagick: “convert: color profile operates on another colorspace `icc'”

Another installment of Sara Beats Her Head Against Tech: When trying to convert images from RGB to CMYK with ImageMagick, the regular command to convert: convert original.jpg -colorspace CMYK new.jpg worked – but the converted image’s colors looked absolutely terrible. So I downloaded some color profiles, and tried to use them: convert original.jpg -colorspace CMYK … [Read more…]

RTFM, Ruby on Rails edition

Since the happymapper google group has been closed to posting, thought I’d toss this up here. I posted this question to the group: ————————————————— I have a node that looks like this: <ItemInfo> <ProductVar text_id=”Variable1″>MyValue</ProductVar> <ProductVar text_id=”Variable2″>MySecondValue</ProductVar> </ItemInfo> I need both the value of the attribute “text_id” and the element value “MyValue”. I was trying … [Read more…]