Prawn 0.6.3 is required due to incompatibility with 0.7 http://github.com/sandal/prawn/issues/#issue/79 ElectionManager - design/import/export an election - register as a user INSTALL # install required gems sudo gem install authlogic # authentication sudo gem install prawn # PDF rake db:reset ttv:seed ttv:develop # initialize the database rake db:test:load ttv:seed RAILS_ENV=test # initialize the test database rake test # run tests script/server # start the server TESTING To test, first set up seed database rake db:test:load # resets the schema rake ttv:seed RAILS_ENV=test # loads up our seed data For this, I had to write custom rake tasks inside lib/db.rake http://stackoverflow.com/questions/1097845/how-to-prevent-rake-test-to-call-task-dbtestprepare TODO - db transaction logging and viewing - import of multiple district sets at the same time (allows us to get california, and a separate set for each county) AJAX flash messages are automatically passed on as X-JSON headers, use to report errors, etc INLINE EDITING Look at doc/InlineEditArchitecture.xls for DOM ids, and general architecture overview accepts_nested_attributes_for useful pages Mentions attr_accessible: http://apidock.com/rails/ActiveRecord/NestedAttributes/ClassMethods/accepts_nested_attributes_for Nested attributes in "new" http://stream.btucker.org/post/93887650/accepts-nested-attributes-for-fields-for Original patch discussion http://weblog.rubyonrails.org/2009/1/26/nested-model-forms Ryan's scraps, http://ryandaigle.com/articles/2008/7/19/what-s-new-in-edge-rails-nested-models TEMPLATES use flash[notice][error] for notifications. In js, use ttv.notice/ttv.error added startAjax, stopAjax, spinner in matching colors http://www.ajaxload.info/ Use prefetching for election to speed up database AUTHENTICATION Using authlogic gem, instructions at http://media.railscasts.com/videos/160_authlogic.mov http://github.com/binarylogic/authlogic_example/tree/master http://www.binarylogic.com/2008/11/16/tutorial-reset-passwords-with-authlogic/ EMAIL Sending mail with gmail requires ruby >=1.8.7, does not work on Leopard default DATA MODELING - I was unable to use autogenerated ids for yaml, too much data Started tracking sessions inside database. FORMS The best documentation is PragProg Mastering Rails Forms video Problem: error messages, default schema is not flexible, ugly layouts Solution: roll your own error solution that displays off the error object ApplicationHelper::render_error_messages is a error_messages_for replacemet The html is defined in: single field: config/initializers/change_field_error.rb ActionView::Base.field_error_proc override error summary _error_messages.html.erb: used by the helper to display the error. ROUTING Extending REST model, priceless: http://railscasts.com/episodes/35-custom-rest-actions Routing: http://guides.rubyonrails.org/routing.html DEBUGGING script/console - execute url_for like this: app.url_for OTHER CODE THAT MIGHT BE USEFUL auto_resize_options[:onKeyPress] = "if (this.scrollHeight > this.clientHeight && !window.opera)\nthis.rows += 1;" http://hobocentral.net/about/ Interesting framework, provides fine-grained permissions, authentication, logging mislav-will-paginate is a recommended pagination gem Drop-down menu for prototype http://www.hongkiat.com/blog/drop-down-menu-30-free-scripts-to-enhance-header-navigation/ http://corelib.rubyonrails.org/ http://littlegreenfootballs.com/article/30490_Tech_Note-_Flippy_Triangle_Style http://www.oscaralexander.com/tutorials/how-to-make-sexy-buttons-with-css.html /activesupport/lib/activesupport/coreext/hash/conversions Hash::to_xml Options for generating seed data: http://derekdevries.com/2009/04/13/rails-seed-data/ Doing i10n in database schemas: http://java.sun.com/blueprints/guidelines/designing_enterprise_applications_2e/i18n/i18n5.html