Using InstantRails and Heroku

December 22, 2009

If you’re using Instant Rails 2.0 and starting to use Heroku, you may have run into trouble installing the heroku gem.

You may need to update rubygems with this command

gem update --system

Once I did that, the normal heroku command line install…

gem install heroku

…worked successfully.

Before that I installed the files they specified in their support documentation locally with commands like

gem install json-1.1.1-mswin32.gem

After downloading the specific *.gem files. I probably wouldn’t have had to do local installs if I had updated rubygems with gem update –system

A Prototype of my New Site

November 6, 2007

I’ve released a prototype of my competition site. Here is the competition to name my site. You can win a book.

Please tell me what you think. It is obviously a work in progress.

I wanted to set a default, checked radio button in a group of radio buttons. Though Agile Development w/Rails is a great book, it doesn’t tell you much about the radio buttons. And most of the examples on the web where unsatisfactory for finding this little detail. Perhaps my search queries were poorly written, but given that I had trouble finding the solution it will probably be valuable to post my own.

The problem lies in that I didn’t quite understand this: “If the current value of method is tag_value the radio button will be checked.” – Rails API for Radio Button Besides, I wanted to arbitrarily set which button was checked. I knew how to do this in normal html/js, but I waned to pass it the adjustment in RoR. In the end, it was actually pretty simple.

All you do is add “:checked = true

Your Ruby looks like this:
<%= form.radio_button :ending, “true”, :checked => true %>

And the page source looks like this:
<input checked=“checked” id=“competition_ending_true” name=“competition[ending]” type=“radio” value=“true” />

This should give you a radio button that is checked by default.

If there are better ways to do it or anything else I’ve missed, there’s always room in the comments for improvements. Rock the RoR!