Notes posted by i_am_camRSS feed
Further to Olly’s note below, you can also specify the protocol to further limit the valid uri’s, else things like ‘ftp ://someurl.com’ (there’s only a space in there to get it to display on here) would be valid.
validates_format_of :uri, :with => URI.regexp(['http'])
Note that as of Rails 2.1, it’s currently not possible to override the internal counter variable you get when using collections via passing it in through :locals.
This is a useful feature when you have a collection of items rendered but then wish to add another one - most likely via an AJAX request.
I’ve been informed it’s back in Edge, so hopefully it’ll re-appear again in Rails 2.2.
When you’re returning HTML content, for example.
By using jQuery’s .ajaxSetup method in such an indiscriminate way (applying it by default to all ajax requests), you make it harder to keep track of what’s returning what.
A better alternative is to use it as a stored function;
and call this from within your .ajax requests when required;