Fun with Javascript and Checkboxes or how to check all your boxes (Ruby on Rails)

Multiple selection areas (where you’re deleting a set of things, hiding them) a la checkbox can seem a little daunting, especially in Rails where everything isn’t done The Way You’re Used To Doing It. Without going too deep, there is a little bit to be said about making all those little Javascript checkboxes toggle on and off without inserting any foreign Javascript outside of the defaults (prototype library, etc) that Rails provides.

Following off of a post on, I started with that and made a toggle box that might have broken a few rules, but can be generally dropped into any Rails application for full toggle switching with one input box. (open in new window)


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: