Thanks to
http://justbarebones.blogspot.com/2007/12/linkto-helper-popup-option-and-ie.html
link_to "View Image", { :action => "view" }, :popup => ['new_window_name', 'height=300,width=600']
Thanks to
http://justbarebones.blogspot.com/2007/12/linkto-helper-popup-option-and-ie.html
link_to "View Image", { :action => "view" }, :popup => ['new_window_name', 'height=300,width=600']
I was working with an iFrame and trying to refresh the parent window when I found Responds to Parent. The first link is the plugin created by Sean Treadway and the second link is a neat tutorial by Khamsouk Souvanlasy.
I was getting an infinite loop with error “too much recursion” when I was using Rails auto_complete and Prototype 1.6.x. Apparently this version isn’t compatible with the version of scriptaculus that is installed with Rails. I went back to prototype 1.5.0 and it worked with no problems.
script/plugin install auto_complete
To add in multiple columns to your collection_select drop-down, create a method in your Model to concatenate:
Model:
def last_name_and_fullname
"#{last_name}, #{full_name}"
end
View:
<%= collection_select :record, :individual_id, Individual.find(:all,
rder => "last_name"), :id, :last_name_and_fullname, {:include_blank => true} %>
Was getting an odd error this morning:
compile error vendor/rails/activerecord/lib/active_record/base.rb:1359: syntax error Object::0
Turned out one of my columns had the name “type”. Not a good thing.
I tried out attachment_fu with Mike Clark’s tutorial and so far so good. This tutorial walks through the process of uploading and saving attachments i.e. images and resizing them into thumbnails. There are so many shady RoR tutorials out there so its refreshing to have Mike Clark explain in a easy going non-technical way. His approach is let Rails do the work for you and I couldn’t agree more.
Mike offers three image processor choices and I tried ImageScience and Minimagick. RMagick was skipped for no particular reason other than it was bigger than what I needed. I tried Minimagick first and I couldn’t get it working at all. Finally I tried ImageScience and with some help I was able to get it working.

Borrowed from Toronto Ruby on Rails pub night.
I was about to write a helper for state and country select drop-downs when I found a handy link:
2 SQL files – 1 for states and 1 for countries. I imported the script into mySQL with no problems. For RoR, I renamed the country table to countries.
http://rubyforge.org/projects/mailee/
Need to fix a few bugs and I’ll post an alpha and more of a description of what it does and doesn’t do.