# Left menu for Fedena Project

**URL:** <https://www.ruby-forum.com/t/left-menu-for-fedena-project/210739>\
**Category:** Rails\
**Created:** [August 16, 2011, 10:38am UTC](https://www.ruby-forum.com/t/left-menu-for-fedena-project/210739 "2011-08-16T10:38:39Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![luislavena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/0ea827/32.png) [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Post date:** [August 16, 2011, 10:38am UTC](https://www.ruby-forum.com/t/left-menu-for-fedena-project/210739/1 "2011-08-16T10:38:39Z")

</div>

i wanna add left menu in the [http://demo.projectfedena.org/](http://demo.projectfedena.org/)  
login:admin password:admin123 as there is no left menu in that i  
thought of adding a left menu. can any one tell how to do that with  
ROR.

---

<div class="post-metadata">

**Author:** ![honey\_ruby](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/7cd45c/32.png) [@honey\_ruby](https://www.ruby-forum.com/u/honey_ruby)\
**Post date:** [August 16, 2011, 11:18am UTC](https://www.ruby-forum.com/t/left-menu-for-fedena-project/210739/2 "2011-08-16T11:18:19Z")

</div>

Hi,

```
 You have to create a partial view with the content for the menu...

```

example:  
“/app/views/shared/\_menu\_left.erb”… there you can put your  
content for the menu.

```
 Later in the file
 "/app/views/layouts/application.html.erb"

  You have to call the partial (just take in consideration html and

```

some conditions like user logged in…)… example:  
“\<%= render(:partial =\> “shared/\_menu\_left.erb”) %\>”

```
 There are many other solutions... as usually depends on the project

```

and the requirements.

```
 I hope it will help you,

```

El 16/08/2011 10:37, honey ruby escribi:

---

<div class="post-metadata">

**Author:** ![honey\_ruby](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/7cd45c/32.png) [@honey\_ruby](https://www.ruby-forum.com/u/honey_ruby)\
**Post date:** [August 16, 2011, 2:42pm UTC](https://www.ruby-forum.com/t/left-menu-for-fedena-project/210739/3 "2011-08-16T14:42:21Z")

</div>

i appreciate for your reply gentlemen but can u explain detail .ok ill  
create the partial page then what is the code i got to write in it if u  
have  
any sample code.

---

<div class="post-metadata">

**Author:** ![honey\_ruby](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/7cd45c/32.png) [@honey\_ruby](https://www.ruby-forum.com/u/honey_ruby)\
**Post date:** [August 16, 2011, 2:47pm UTC](https://www.ruby-forum.com/t/left-menu-for-fedena-project/210739/4 "2011-08-16T14:47:21Z")

</div>

On 16 August 2011 13:41, hanish jadala [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> i appreciate for your reply gentlemen but can u explain detail .ok ill  
> create the partial page then what is the code i got to write in it if u have  
> any sample code.

Do you know what you want to do using html and css directly? If not  
then you need to learn about html and css. RoR is a framework to make  
it easier to build websites, but you still need to know about html and  
css.

Colin

---

<div class="post-metadata">

**Author:** ![honey\_ruby](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/7cd45c/32.png) [@honey\_ruby](https://www.ruby-forum.com/u/honey_ruby)\
**Post date:** [August 16, 2011, 3:08pm UTC](https://www.ruby-forum.com/t/left-menu-for-fedena-project/210739/5 "2011-08-16T15:08:21Z")

</div>

On 16 August 2011 13:57, hanish jadala [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

Please don’t top post, it makes it difficult to follow the thread.  
Insert your reply at appropriate points in the previous message.  
Thanks.

> yeah i have a very good idea of html and css . but the thing i need to a  
> left menu using ROR. how can i do that. if u can visit the site  
> [demo.projectfedena.org](http://demo.projectfedena.org) with LOGIN :admin and PASSWORD: admin123 there is  
> menu on the top i want that menu to the left side . just see the site then u  
> can help me out much better

So you know what you want to do in html and css. So change the site  
to generate the appropriate html and css. Which bit is it that you do  
not know how to do?

All I will see if I look at your site will be html, javascript and  
css, but you say you know what you want that to become, so there is no  
point me looking at it. If you do not know how to generate the html  
from RoR then give an example of one of the bits you are not sure how  
to do.

Colin

---

<div class="post-metadata">

**Author:** ![honey\_ruby](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/7cd45c/32.png) [@honey\_ruby](https://www.ruby-forum.com/u/honey_ruby)\
**Post date:** [August 16, 2011, 3:27pm UTC](https://www.ruby-forum.com/t/left-menu-for-fedena-project/210739/6 "2011-08-16T15:27:30Z")

</div>

i hope u saw the site . there is a menu on the top rite so, if i need  
that  
menu on left side of the screen what should i do. i mean how to write  
the  
code of that.

---

<div class="post-metadata">

**Author:** ![honey\_ruby](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/7cd45c/32.png) [@honey\_ruby](https://www.ruby-forum.com/u/honey_ruby)\
**Post date:** [August 16, 2011, 2:59pm UTC](https://www.ruby-forum.com/t/left-menu-for-fedena-project/210739/7 "2011-08-16T14:59:43Z")

</div>

yeah i have a very good idea of html and css . but the thing i need to a  
left menu using ROR. how can i do that. if u can visit the site  
[demo.projectfedena.org](http://demo.projectfedena.org) with LOGIN :admin and PASSWORD: admin123 there is  
menu on the top i want that menu to the left side . just see the site  
then u  
can help me out much better

---

<div class="post-metadata">

**Author:** ![honey\_ruby](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/7cd45c/32.png) [@honey\_ruby](https://www.ruby-forum.com/u/honey_ruby)\
**Post date:** [August 16, 2011, 4:03pm UTC](https://www.ruby-forum.com/t/left-menu-for-fedena-project/210739/8 "2011-08-16T16:03:20Z")

</div>

Hi,  
  
 &nbsp;&nbsp;&nbsp; Assuming the code is the same as ["https://github.com/projectfedena/projectfedena\_v2.0"](https://github.com/projectfedena/projectfedena_v2.0)  
  
 &nbsp;&nbsp;&nbsp; You can find the upper menu embedded in "/app/views/layouts/application.html.erb"

```
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<div id="main-menu"\>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<%= link\_to "Dashboard", :controller =\> "user", :action =\> "dashboard" %\>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<% this\_user = User.find(session[:user\_id]) if session[:user\_id] %\>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<%if this\_user.student? || this\_user.employee? %\>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<%= link\_to "Calendar" ~~, :controller =\> "calendar" %\>~~

~~&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<% end %\>~~

~~&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<%= link\_to "Students", :controller =\> "student", :action =\> "index" \~~

~~&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if this\_user.admin? %\>~~

~~&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<%= link\_to "Attendance", :controller =\> "student\_attendance", :action =\> "index" \~~

~~&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if this\_user.admin? %\>~~

~~&nbsp;&nbsp;&nbsp;&nbsp ;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<%= link\_to "Settings", :controller =\> "configuration", :action =\> "index" \~~

~~&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if this\_user.admin? %\> \<!--~~

~~\<%= link\_to "News", :controller =\> \< span class="s2"\>"news", :action =\> "index" \~~

~~&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if this\_user.admin? %\> --\>~~

~~&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<%= link\_to "Timetable", :controller =\> "timetable", :action =\> "index" \~~

~~&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if this\_user.admin? %\>~~

~~&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<% if this\_user.admin? %\>~~

~~&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<a href="#" class="menuanchorclass" rel="anylinkmenu1"\>More ▼\</a\>~~
~~&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<% end %\>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\</div\>
~~
```
~~   
 &nbsp;&nbsp;&nbsp; An easy solution will be (same menu everywhere), change the CSS of "main-menu" and creating "sidebar\_menu"&nbsp; and some code like this:  
 
```
<div id="main-menu">
    <% this_user = User.find(session[:user_id])%>
    <ul class="sidebar_menu">
      <li><%= link_to "Dashboard", :controller => "user", 
:action => "dashboard" %></li>
      <% if this_user.student? || this_user.employee? %>
        <li><%= link_to "Calendar", :controller => 
"calendar" %></li>
      <% end %>
      <% if this_user.admin? %>
        <li><%= link_to "Students", :controller => 
"student", :action => "index" %></li>
        <li><%= link_to "Attendance", :controller => 
"student_attendance", :action => "index" %></li>
        <li><%= link_to "Settings", :controller => 
"configuration", :action => "index" %></li>
        <li><%= link_to "News", :controller => "news", 
:action => "index" %> </li>
        <li><%= link_to "Timetable", :controller => 
"timetable", :action => "index" %></li>
      <% end %>
    </ul>
    <a href="#" class="menuanchorclass" rel="anylinkmenu1">More 
</a>
  </div>
```
   
 &nbsp;&nbsp;&nbsp; No need of partial or magic ROR... just HTML and CSS.  
   
 &nbsp;&nbsp;&nbsp; Greetings,   
   
 El 16/08/2011 15:25, hanish jadala escribió: 

> &nbsp;i hope u saw the &nbsp;site . there is a menu on the top rite so, if i need that menu on left side of the screen &nbsp;what should i do. i mean how to write the code of that. --   
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.  
> To post to this group, send email to [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid).  
> To unsubscribe from this group, send email to [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid).  
> For more options, visit this group at [http://groups.google.com/group/rubyonrails-talk?hl=en](http://groups.google.com/group/rubyonrails-talk?hl=en).

   
 
```
--
Miquel C. Escarré
+34 699 73 22 46[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

“Computers are good at following instructions, but not at reading your  
mind.” Donald Knuth.

“Los ordenadores son buenos siguiendo instrucciones, pero no leyendo tu  
mente.” Donald Knuth.
```
~~

–   
  
You received this message because you are subscribed to the Google  
Groups “Ruby on Rails: Talk” group.  
  
To post to this group, send email to  
removed\_email\_address@domain.invalid.  
  
To unsubscribe from this group, send email to  
removed\_email\_address@domain.invalid.

For more options, visit this group at  
[http://groups.google.com/group/rubyonrails-talk?hl=en.](http://groups.google.com/group/rubyonrails-talk?hl=en.)
