RailsCasts Pro episodes are now free!

Learn more or hide this

Brent's Profile

GitHub User: brentertz

Site: brentertz.com

Comments by Brent

Avatar

I find this configuration very useful as well. Further, I prefer to add a defaults section to the YAML config file, and allow let the other sections to inherit from that.

yaml
defaults: &defaults
  email: info@example.com

development:
  <<: *defaults
  email: me@example.com

test:
  <<: *defaults
  email: test@example.com

staging:
  <<: *defaults

production:
  <<: *defaults
Avatar

The preferred method would be to use event delegation using .on() and bind a single click handler to the parent element $('.tasks') and then check the event target to determine the appropriate behavior. This would handle new tasks added after the initial load and would only require a single event binding, rather that one for each task.

Avatar

In HAML/Rails3...

%title<
  Shopper - #{ content_for?(:title) ? yield(:title) : 'The Place to Buy Stuff' }