# Dynamic menu/role design

**URL:** <https://www.ruby-forum.com/t/dynamic-menu-role-design/172935>\
**Category:** Rails\
**Created:** [July 30, 2009, 6:46am UTC](https://www.ruby-forum.com/t/dynamic-menu-role-design/172935 "2009-07-30T06:46:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![stardust](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/41988e/32.png) [@stardust](https://www.ruby-forum.com/u/stardust)\
**Post date:** [July 30, 2009, 6:46am UTC](https://www.ruby-forum.com/t/dynamic-menu-role-design/172935/1 "2009-07-30T06:46:37Z")

</div>

My project is a small online course.  
A course has four terms and each term has ten lessons.  
When you start the course you get access to the course intro and the  
first term intro and the first lesson.  
Every week you get an email saying that it’s time for your weekly lesson  
and when you log in, the side navigation bar shows links that give you  
access to the next lesson, so that you always have access to everything  
you have already done plus the new lesson each week.  
I’m not really sure how to start on this, any suggestions would be most  
welcome.

---

<div class="post-metadata">

**Author:** ![stardust](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/41988e/32.png) [@stardust](https://www.ruby-forum.com/u/stardust)\
**Post date:** [July 31, 2009, 12:43am UTC](https://www.ruby-forum.com/t/dynamic-menu-role-design/172935/2 "2009-07-31T00:43:13Z")

</div>

Ziggy L. wrote:  
[…]

> I’m not really sure how to start on this, any suggestions would be most  
> welcome.

What part are you having trouble with?

## Best,

Marnen Laibow-Koser  
[http://www.marnen.org](http://www.marnen.org)  
removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![stardust](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/41988e/32.png) [@stardust](https://www.ruby-forum.com/u/stardust)\
**Post date:** [July 31, 2009, 10:11am UTC](https://www.ruby-forum.com/t/dynamic-menu-role-design/172935/3 "2009-07-31T10:11:53Z")

</div>

2009/7/30 Ziggy L. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> welcome.  
> If I were in this situation I would start by getting the models setup  
> with their relationships, using the scaffolds to build simple CRUD  
> interfaces and provide tests to make sure that is working ok. Once  
> that is going then you can build on top the UI that you want, a bit at  
> a time, knowing that the underlying data is ok. Later you can remove  
> any bits of the scaffold that are redundant.

Others would tackle this differently of course.

Colin

---

<div class="post-metadata">

**Author:** ![stardust](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/41988e/32.png) [@stardust](https://www.ruby-forum.com/u/stardust)\
**Post date:** [August 5, 2009, 7:12am UTC](https://www.ruby-forum.com/t/dynamic-menu-role-design/172935/4 "2009-08-05T07:12:40Z")

</div>

the data model looks like this:

a course has many terms  
a term has many lessons  
a lesson has many components

a user subscribes to a course.

As I mentioned before, when the user subscribes they get an email once a  
week to tell them that their new lesson is now available.

In order to present the user with a side navigation menu of all the  
lessons that they have completed thus far and now - after the email  
notification - including the new one for the current week I think  
something like this ought to work:

When the user logs in I want to be able to find the course the user has  
subscribed to. (maybe a field in the user database table [what if they  
have subscribed to two courses???])  
When the user logs in I want to be able to find out what term the user  
is currently doing. (maybe another field in the database table)  
maybe one more field for the current lesson?

I guess this is where I’m then kind of lost, how does all this get  
passed up to the view to render the menu?  
the other thing that will need some smarts is updating the user model  
with next term and next lesson.

Oh yes, I have the course basics up and running with shallow nested  
routes, took me a while to get all that, the notification and menu is  
core functionality though that I’m stuck on!
