This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
| name | age | message | |
|---|---|---|---|
| |
.gitignore | Wed Dec 09 20:09:49 -0800 2009 | |
| |
BALLOTS.README | Wed Dec 09 20:09:49 -0800 2009 | |
| |
README | Mon Nov 30 20:53:07 -0800 2009 | |
| |
Rakefile | Thu Oct 15 15:52:37 -0700 2009 | |
| |
app/ | Wed Dec 09 20:09:49 -0800 2009 | |
| |
ballots/ | Wed Dec 09 20:18:59 -0800 2009 | |
| |
config/ | Wed Dec 09 20:09:49 -0800 2009 | |
| |
db/ | Wed Dec 09 20:09:49 -0800 2009 | |
| |
doc/ | Thu Oct 15 16:08:22 -0700 2009 | |
| |
lib/ | Wed Dec 09 20:18:59 -0800 2009 | |
| |
public/ | Fri Dec 04 14:45:41 -0800 2009 | |
| |
script/ | Thu Oct 15 16:08:22 -0700 2009 | |
| |
test/ | Wed Dec 09 20:09:49 -0800 2009 |
README
ElectionManager - design/import/export an election - register as a user INSTALL # install required gems # authlogic sudo gem install authlogic # authentication # PDFlib get PDFlib, version 8 from www.pdflib.com cp PDFlib.bundle /Library/Ruby/Site/1.8/ # on OS X leopard # initialize the database using these custom tasks # this will generate a site with a single dummy election, and no users rake db:reset ttv:seed ttv:develop # start the server script/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







