RailsCasts Pro episodes are now free!

Learn more or hide this

aokolish's Profile

GitHub User: aokolish

Site: aokolish.me

Comments by aokolish

Avatar

Cool stuff, Ryan. I would change the end of your coffeescript a bit. It is more efficient to use chaining rather than select the #person_state_id element on back to back lines. Plus, I like that it is more concise. Like this:

javascript
if options
  $('#person_state_id').html(options).parent().show()
else
  $('#person_state_id').empty().parent().hide()