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 (
commit be3e182f5c5aad777ebd62790bfc182a450cd06e
tree 29e1423a5a47c76cc3d99958162bb203788885ce
parent fd997011e0b05b1a99e58e20d21f922560533308
tree 29e1423a5a47c76cc3d99958162bb203788885ce
parent fd997011e0b05b1a99e58e20d21f922560533308
| name | age | message | |
|---|---|---|---|
| |
.gitignore | ||
| |
README | ||
| |
Rakefile | Thu Oct 15 15:52:37 -0700 2009 | |
| |
app/ | ||
| |
config/ | ||
| |
db/ | ||
| |
doc/ | Thu Oct 15 16:08:22 -0700 2009 | |
| |
lib/ | ||
| |
log/ | ||
| |
public/ | ||
| |
script/ | Thu Oct 15 16:08:22 -0700 2009 | |
| |
test/ | ||
| |
tmp/ |
README
ElectionManager - design/import/export an election - register as a user - LA ballots http://smartvoter.org/2008/11/04/ca/la/ballot.html 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 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 TODO - db transaction logging and viewing 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








