Ruby on Rails
LeeO (Version #91)
| My name is Lee O’Mara. I’m an Ottawa area programmer and web generalist. I’m also a terrible speller. |
email: “lee@omara.ca” | homepage: http://omara.ca | irc: leeo
API doc remix
alternate layout

I didn’t care for the layout of the api docs, so I came up with an alternative frameset for Rails documentation that collapses the three lists into one tall frame to provide more vertical room for the main document.
Search

I’ve also added a search field (as of april 15). Feel free to use, copy, or improve it. The current implementation allows you to search the API docs(using google) and to search the wiki as well.
Other Docs
I’ve copied the general approach used in the Rails Documentation for Ruby core documentation and the Ruby standard library as well.
Todo
Idea Garden
To inspire myself and others I’ll try to cultivate the random Rails-related ideas that flutter by. Also, being a skilled procastinator, I make sure I’m never short on ideas for potential distraction. Let the creativity goblin be your friend.
I’m sure that these are not entirely novel or original, and probably most of them are not my ideas, but I’ll keep them here none the less. I will not likely get to most(if any) of these, but writing them here will help keep my desk clean.
Feel free to comment on or expand any of these. If you plan on using these, I’d love to know!
- online colaborative text editor—think subethaedit meets hotmail(or something). Somewhere between a chat app and a live wiki. [Update: July 16, 05] It seems that Jotspot is working on a similar idea see also this post about JotSpot Live
- online calendar app. sharable? I guess, it’s all the rage, and all the cool kids are doing it. It could be fun to make use of Runt
- navigation helpers—get the sitemap working in good order. automatic breadcrumbing (wonder how to remember page names). maybe code from the sitemap can be used to generate some simple navigation tree structures?
- built-in versioning—maybe
acts_as_versioned ? Gives access to #current, or #revisions. Creates a \VersionedModel class and an observer to manage the versioning in a (mostly) transparent manner. Would depend on a second table: ex. foos and foo_revisions. +-------+ +------------+
| pages | | revisions |
|-------| |------------|
| id |<-*| page_id |
| data | | rev. data |
+-------+ | model data |
+------------+
Where revision data would include revision number, and what else? What other info would be required of a revision, but not of a model itself?
I wonder what kind of conditions would be usefull in determining if a “save” should lead to a new revision?
The id of the “current” record should be consistent to ease associations. Calculating associations through the revisions table might be tricky, especially if those associations can be “versioned”. What is the “scope” of a revision? Changing a models attributes, it’s relationships?, hmm, more thought required
[Update: July 16, 05] Technoweenie has put together ActsAsVersioned that does most of this.
- figure out how to get #build and #create to work for
has_one and belongs_to when no record already associated.
- Rails diagnostic script. tests for common Rails ailments, such as: installed, accessible Ruby version; methods named like models, or reserved words; habtm table with id field; other table missing an id field. Theres a partial list of reserved words on the Gotcha page. Something along the lines of a Rails Lint.
- a directory browser—a simple light-weight app. Need not even touch a DB(no AR). Could later be extended to allow file manipulation(rename, delete, edit). Something like http://filenice.com/
- \RoRMyAdmin—pointless perhaps, but still. The original was a learning exercise as well.
- test how browsers react to PUT and DELETE as form methods. This could potentially be used to drive a multi-purpose postback-style behaviour. The same url could be used to show, save or delete a record. Nevermind, IE only support GET or POST. Oh well.
- GET - show
- PUT - save a record (any reason this is preffered over POST?)
- DELETE - delete a record
- db_data model generator and helper – a model generator, db schema and controller helper that makes working with binary data in the db even easier. Provides super-simple view. Assumes the following fields(or at least makes use of them when available): mime-type, timestamp of some sort, description. Automatic
if-modified-since behaviour if timestamp field exists.
Xal mad mention of a setup where models kept their binary data in a seperate table so as to not burden regular queries with the large BLOBs.
- put up an example(in the cookbook, perhaps?) showing how to have the controller execute a different method based on which button was used to submit the form. Ex:
<input name="submit" type="submit" value="Edit" />
<input name="txt2html" type="submit" value="mach html" />
- Add
<link> tags to the PaginationHelper or anywhere else in Rails. You know: next, previous, .. hmm what are the other relationships again? Ah, yes here they are mmm. top, index, start, author, help, copyright. Nearly all apps could(should?) have those. chapter, section, subsection—hello Hieraki!
- FreeTag for Rails. Derived from Snippets ? [Update: August 27, 05] DemetriusNunes has stepped up and put together
acts_as_taggable—Read about it on his blog
- look into abstracting a system for doing guide-task-flow or wizard-task-flow. See this article and also HowToBuildMultiStageFormssee also Scott Barron’s Act as State Machine.
- if-modified-since filter Inspired by the call for better behaving frameworks
<span class="newWikiWord">FooController<a href="http://wiki.rubyonrails.com/rails/pages/FooController">?</a></span> < <a href="http://wiki.rubyonrails.com/rails/pages/ActionController" class="existingWikiWord">ActionController</a>::Base
pre_filter :if_modified_since {
User.find(@params['id']).updated_at
}, :only => :show
..
- demo Rails REST app create a new(or take an existing) Rails app and develop a RESTfull API for it.Charlie Savage has done some work on a REST plugin
http://cfis.savagexi.com/articles/2006/03/26/rest-controller-for-rails
- shortstat or refer like app. Could use them new-fangled mini-graphics . [Update: August 17, 05] LubenManolov? has released RailStat
- an ActiveRecordMigration script to use ActiveRecord as a session handler—yes it would be simple, but still a nice thing to have
- A plugin directory application.
Fun with Rich-Javascript & XHR
- chat—here’s an example that uses XmlHTTPRequest: http://www.plasticshore.com/viewEntry.php?id=205
- rewrite any of the nicer tutorials using XHR
- a FAQ manager—a bit more than \TaDa, should include categories. There are a number of examples available(in Ruby/Rails even)
- inline edit Scaffold that merges view/edit. double-click on a value → turns into an input, etc. Might need to handle validation of one field at a time?
- auto-save form helper This idea has been floating around for a bit. Now apparently blogger has it → http://photomatt.net/2005/04/11/blogging-autosave/ Could be done using cookies only.
- minimalist CMS Using edit in place to remove the whole “edit interface”. Layout attaches JS that hooks into page. Probably somewhat wiki-like.
- Help Rails ajax do the right thing by default. See Usable XMLHttpRequest in Practice for inspiration.
Thoughts about ROR documentation
see DocumentationDiscussion
WikiMailbox
discussion moved to
WikiStyleGuide
| My name is Lee O’Mara. I’m an Ottawa area programmer and web generalist. I’m also a terrible speller. |
email: “lee@omara.ca” | homepage: http://omara.ca | irc: leeo
API doc remix
alternate layout

I didn’t care for the layout of the api docs, so I came up with an alternative frameset for Rails documentation that collapses the three lists into one tall frame to provide more vertical room for the main document.
Search

I’ve also added a search field (as of april 15). Feel free to use, copy, or improve it. The current implementation allows you to search the API docs(using google) and to search the wiki as well.
Other Docs
I’ve copied the general approach used in the Rails Documentation for Ruby core documentation and the Ruby standard library as well.
Todo
Idea Garden
To inspire myself and others I’ll try to cultivate the random Rails-related ideas that flutter by. Also, being a skilled procastinator, I make sure I’m never short on ideas for potential distraction. Let the creativity goblin be your friend.
I’m sure that these are not entirely novel or original, and probably most of them are not my ideas, but I’ll keep them here none the less. I will not likely get to most(if any) of these, but writing them here will help keep my desk clean.
Feel free to comment on or expand any of these. If you plan on using these, I’d love to know!
- online colaborative text editor—think subethaedit meets hotmail(or something). Somewhere between a chat app and a live wiki. [Update: July 16, 05] It seems that Jotspot is working on a similar idea see also this post about JotSpot Live
- online calendar app. sharable? I guess, it’s all the rage, and all the cool kids are doing it. It could be fun to make use of Runt
- navigation helpers—get the sitemap working in good order. automatic breadcrumbing (wonder how to remember page names). maybe code from the sitemap can be used to generate some simple navigation tree structures?
- built-in versioning—maybe
acts_as_versioned ? Gives access to #current, or #revisions. Creates a \VersionedModel class and an observer to manage the versioning in a (mostly) transparent manner. Would depend on a second table: ex. foos and foo_revisions. +-------+ +------------+
| pages | | revisions |
|-------| |------------|
| id |<-*| page_id |
| data | | rev. data |
+-------+ | model data |
+------------+
Where revision data would include revision number, and what else? What other info would be required of a revision, but not of a model itself?
I wonder what kind of conditions would be usefull in determining if a “save” should lead to a new revision?
The id of the “current” record should be consistent to ease associations. Calculating associations through the revisions table might be tricky, especially if those associations can be “versioned”. What is the “scope” of a revision? Changing a models attributes, it’s relationships?, hmm, more thought required
[Update: July 16, 05] Technoweenie has put together ActsAsVersioned that does most of this.
- figure out how to get #build and #create to work for
has_one and belongs_to when no record already associated.
- Rails diagnostic script. tests for common Rails ailments, such as: installed, accessible Ruby version; methods named like models, or reserved words; habtm table with id field; other table missing an id field. Theres a partial list of reserved words on the Gotcha page. Something along the lines of a Rails Lint.
- a directory browser—a simple light-weight app. Need not even touch a DB(no AR). Could later be extended to allow file manipulation(rename, delete, edit). Something like http://filenice.com/
- \RoRMyAdmin—pointless perhaps, but still. The original was a learning exercise as well.
- test how browsers react to PUT and DELETE as form methods. This could potentially be used to drive a multi-purpose postback-style behaviour. The same url could be used to show, save or delete a record. Nevermind, IE only support GET or POST. Oh well.
- GET - show
- PUT - save a record (any reason this is preffered over POST?)
- DELETE - delete a record
- db_data model generator and helper – a model generator, db schema and controller helper that makes working with binary data in the db even easier. Provides super-simple view. Assumes the following fields(or at least makes use of them when available): mime-type, timestamp of some sort, description. Automatic
if-modified-since behaviour if timestamp field exists.
Xal mad mention of a setup where models kept their binary data in a seperate table so as to not burden regular queries with the large BLOBs.
- put up an example(in the cookbook, perhaps?) showing how to have the controller execute a different method based on which button was used to submit the form. Ex:
<input name="submit" type="submit" value="Edit" />
<input name="txt2html" type="submit" value="mach html" />
- Add
<link> tags to the PaginationHelper or anywhere else in Rails. You know: next, previous, .. hmm what are the other relationships again? Ah, yes here they are mmm. top, index, start, author, help, copyright. Nearly all apps could(should?) have those. chapter, section, subsection—hello Hieraki!
- FreeTag for Rails. Derived from Snippets ? [Update: August 27, 05] DemetriusNunes has stepped up and put together
acts_as_taggable—Read about it on his blog
- look into abstracting a system for doing guide-task-flow or wizard-task-flow. See this article and also HowToBuildMultiStageFormssee also Scott Barron’s Act as State Machine.
- if-modified-since filter Inspired by the call for better behaving frameworks
<span class="newWikiWord">FooController<a href="http://wiki.rubyonrails.com/rails/pages/FooController">?</a></span> < <a href="http://wiki.rubyonrails.com/rails/pages/ActionController" class="existingWikiWord">ActionController</a>::Base
pre_filter :if_modified_since {
User.find(@params['id']).updated_at
}, :only => :show
..
- demo Rails REST app create a new(or take an existing) Rails app and develop a RESTfull API for it.Charlie Savage has done some work on a REST plugin
http://cfis.savagexi.com/articles/2006/03/26/rest-controller-for-rails
- shortstat or refer like app. Could use them new-fangled mini-graphics . [Update: August 17, 05] LubenManolov? has released RailStat
- an ActiveRecordMigration script to use ActiveRecord as a session handler—yes it would be simple, but still a nice thing to have
- A plugin directory application.
Fun with Rich-Javascript & XHR
- chat—here’s an example that uses XmlHTTPRequest: http://www.plasticshore.com/viewEntry.php?id=205
- rewrite any of the nicer tutorials using XHR
- a FAQ manager—a bit more than \TaDa, should include categories. There are a number of examples available(in Ruby/Rails even)
- inline edit Scaffold that merges view/edit. double-click on a value → turns into an input, etc. Might need to handle validation of one field at a time?
- auto-save form helper This idea has been floating around for a bit. Now apparently blogger has it → http://photomatt.net/2005/04/11/blogging-autosave/ Could be done using cookies only.
- minimalist CMS Using edit in place to remove the whole “edit interface”. Layout attaches JS that hooks into page. Probably somewhat wiki-like.
- Help Rails ajax do the right thing by default. See Usable XMLHttpRequest in Practice for inspiration.
Thoughts about ROR documentation
see DocumentationDiscussion
WikiMailbox
discussion moved to
WikiStyleGuide
Created on May 07, 2006 14:15
by
maurycy (83.21.158.54)