-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path66-move-membership-to-sidebar.patch
31 lines (20 loc) · 1.45 KB
/
66-move-membership-to-sidebar.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
move-membership-to-sidebar
From: Bryan Larsen <[email protected]>
## The view layer
We would like the list of project memberships to appear in a side-bar on the project show page, so the page will now display two collections: stories and memberships. We can tell Rapid that these are the two collections we are interested in using Hobo's [*View Hints*](/manual/viewhints). Edit the file `app/viewhints/project_hints.rb` to look like this:
SHOW_PATCH
It is very common for websites to present information in a hierarchy, and this `children` declaration tells Hobo about the hierarchy of your data. The order is significant; in this example `stories` is the 'main' child relationship, and `memberships` is secondary. The Rapid page generators use this information and place the `stories` collection in the main area of the page, and an aside section will be added for the `memberships`.
Refresh any project page and you should see the collection, which will be empty of course, in a side-bar.
---
app/viewhints/project_hints.rb | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/app/viewhints/project_hints.rb b/app/viewhints/project_hints.rb
index 49e3aea..b1cfaf9 100644
--- a/app/viewhints/project_hints.rb
+++ b/app/viewhints/project_hints.rb
@@ -1,6 +1,6 @@
class ProjectHints < Hobo::ViewHints
- children :stories
+ children :stories, :memberships
# model_name "My Model"
# field_names :field1 => "First Field", :field2 => "Second Field"