public
Description: Markdown sources for http://hobocentral.net
Homepage: http://hobocentral.net
Clone URL: git://github.com/tablatom/hobocentral.git
Improvements to docs
tablatom (author)
Thu Apr 24 14:15:41 -0700 2008
commit  9a748f4f34faf460e1efec4157a0a5c5a0e1cc31
tree    4bdbd628167f93f07a84fd590e0ff3f6ec6e4596
parent  40e8bf790f5ce6963d54b63268558ea869509638
...
120
121
122
123
124
125
 
126
127
128
...
120
121
122
 
123
 
124
125
126
127
0
@@ -120,9 +120,8 @@ The associations go just below the `fields do ... end` declaration in each model
0
     class Story < ActiveRecord::Base
0
       ...
0
       belongs_to :project
0
- belongs_to :status, :class_name => "StoryStatus", :foreign_key => "status_id"
0
       
0
- has_many :tasks, :order => 'position', :dependent => :destroy
0
+ has_many :tasks, :dependent => :destroy
0
       ...
0
     end
0
 {: .ruby}
...
4
5
6
 
 
 
7
8
9
...
4
5
6
7
8
9
10
11
12
0
@@ -4,6 +4,9 @@
0
 
0
  * [What is Hobo?](/about)
0
  * [Try it - create an app in two Minutes](/two-minutes)
0
+ * [Detailed install instructions for Windows][1] (external link, PDF)
0
+
0
+[1]: http://owendall.files.wordpress.com/2008/04/installing-ruby-rails-and-hobo-075-on-windows-xp1.pdf
0
 
0
 ## Tutorials
0
 
...
103
104
105
106
 
107
108
109
...
112
113
114
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
...
103
104
105
 
106
107
108
109
...
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
0
@@ -103,7 +103,7 @@ to `admin.dryml` we can replace the normal list on an index page with an admin s
0
     <def tag="index-page" extend-with="admin">
0
       <index-page-without-admin merge>
0
         <collection: replace>
0
- <table-plus fields="username, administrator" param/>
0
+ <table-plus fields="this" param/>
0
         </collection:>
0
       </index-page-without-admin>
0
     </def>
0
@@ -112,3 +112,38 @@ to `admin.dryml` we can replace the normal list on an index page with an admin s
0
 If we add additional model controllers to the admin sub-site they will all use this modified
0
 version of `<index-page>`. Similar admin specific tweaks can be made to the other generic pages
0
 and tags.
0
+
0
+Notice the `fields` attribute on `<table-plus>`. This attribute is given a list of fields that will appear as columns in the table. Our shared definition of `<index-page>` can't put anything model-specific in there, so we just use "this" which will give a single column with links to each show-page. The good thing is that it's easy to customise this for specific models. For example, say we'd like to add an `email_address` column for the `User` model, just create `app/views/admin/users/index.dryml` like this:
0
+
0
+ <index-page>
0
+ <table-plus: fields="this, email_address"/>
0
+ </index-page>
0
+{: .dryml}
0
+
0
+Notice that the call to `<index-page>` picks up our customised version, since we've overridden it for the entire admin sub-site.
0
+
0
+
0
+
0
+
0
+
0
+
0
+
0
+
0
+
0
+
0
+
0
+
0
+
0
+
0
+
0
+
0
+
0
+
0
+
0
+
0
+
0
+
0
+
0
+
0
+
0
+

Comments

    No one has commented yet.