Notes posted by szeryfRSS feed
…you’re probably looking for http://apidock.com/rails/ActiveRecord/Calculations/ClassMethods/count
Please note that using default to_xml or to_json methods can lead to security holes, as these method expose all attributes of your model by default, including salt, crypted_password, permissions, status or whatever you might have.
You might want to override these methods in your models, e.g.:
def to_xml super( :only => [ :login, :first_name, :last_name ] ) end
Or consider not using responds_to at all, if you only want to provide HTML.
See http://apidock.com/rails/ActionController/TestProcess/fixture_file_upload for easier way to test file uploads.
This outputs date & time in format of yyyy-MM-ddThh-mm-ssZZZ. All values are preceded with 0 if less than 10. Hours are in 0..23 range. Timezone is sticked at the end. Watch out for capital T in the middle :)
Good docs can be found here: http://www.artweb-design.de/2008/7/18/the-ruby-on-rails-i18n-core-api
See also: http://rails-i18n.org/wiki for an extensive list of resources.
assert_template :new # WON'T WORK!
But you can use Regexp, e.g.:
assert_template /new/ # WORKS OK
assert_template /^new$/ # WON'T WORK!
However this might: