<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi,<br>
<br>
Assuming the code is the same as
<a class="moz-txt-link-rfc2396E"
href="https://github.com/projectfedena/projectfedena_v2.0">"https://github.com/projectfedena/projectfedena_v2.0"</a><br>
<br>
You can find the upper menu embedded in
"/app/views/layouts/application.html.erb"<br>
<br>
<pre><div class="line" id="LC46"><font
color="#999999"> <span
class="nt"><div</span> <span
class="na">id=</span><span
class="s">"main-menu"</span><span
class="nt">></span></font></div><div
class="line" id="LC47"><font
color="#999999"> <span
class="cp"><%=</span> <span
class="n">link_to</span> <span
class="s2">"Dashboard"</span><span
class="p">,</span> <span
class="ss">:controller</span> <span
class="o">=></span> <span
class="s2">"user"</span><span
class="p">,</span> <span
class="ss">:action</span> <span
class="o">=></span> <span
class="s2">"dashboard"</span> <span
class="cp">%></span></font></div><div
class="line" id="LC48"><font
color="#999999"> <span
class="cp"><%</span> <span
class="n">this_user</span> <span
class="o">=</span> <span
class="no">User</span><span
class="o">.</span><span c
lass="n">find</span><span
class="p">(</span><span
class="n">session</span><span
class="o">[</span><span
class="ss">:user_id</span><span
class="o">]</span><span
class="p">)</span> <span
class="k">if</span> <span
class="n">session</span><span
class="o">[</span><span
class="ss">:user_id</span><span
class="o">]</span> <span
class="cp">%></span></font></div><div
class="line" id="LC49"><font
color="#999999"> <span
class="cp"><%</span> <span
class="k">if</span> <span
class="n">this_user</span><span
class="o">.</span><span
class="n">student?</span> <span
class="o">||</span> <span
class="n">this_user</span><span
class="o">.</span><span
class="n">employee?</span> <span
class="cp">%></span></font></div><div
class="line" id="LC50"><font
color="#999999"> <span
class="cp"><%=</span> <span
class="n">link_to</span> <span
class="s2">"Calendar"</span><s
pan class="p">,</span> <span
class="ss">:controller</span> <span
class="o">=></span> <span
class="s2">"calendar"</span> <span
class="cp">%></span></font></div><div
class="line" id="LC51"><font
color="#999999"> <span
class="cp"><%</span> <span
class="k">end</span> <span
class="cp">%></span></font></div><div
class="line" id="LC52"><font
color="#999999"> <span
class="cp"><%=</span> <span
class="n">link_to</span> <span
class="s2">"Students"</span><span
class="p">,</span> <span
class="ss">:controller</span> <span
class="o">=></span> <span
class="s2">"student"</span><span
class="p">,</span> <span
class="ss">:action</span> <span
class="o">=></span> <span
class="s2">"index"</span> <span
class="p">\</span></font></div><div
class="line" id="LC53"><font
color="#999999"> <span
clas
s="k">if</span> <span
class="n">this_user</span><span
class="o">.</span><span
class="n">admin?</span> <span
class="cp">%></span></font></div><div
class="line" id="LC54"><font
color="#999999"> <span
class="cp"><%=</span> <span
class="n">link_to</span> <span
class="s2">"Attendance"</span><span
class="p">,</span> <span
class="ss">:controller</span> <span
class="o">=></span> <span
class="s2">"student_attendance"</span><span
class="p">,</span> <span
class="ss">:action</span> <span
class="o">=></span> <span
class="s2">"index"</span> <span
class="p">\</span></font></div><div
class="line" id="LC55"><font
color="#999999"> <span
class="k">if</span> <span
class="n">this_user</span><span
class="o">.</span><span
class="n">admin?</span> <span
class="cp">%></span></font></div><div
class="line" id="LC56"><font
color="#999999">  
; <span
class="cp"><%=</span> <span
class="n">link_to</span> <span
class="s2">"Settings"</span><span
class="p">,</span> <span
class="ss">:controller</span> <span
class="o">=></span> <span
class="s2">"configuration"</span><span
class="p">,</span> <span
class="ss">:action</span> <span
class="o">=></span> <span
class="s2">"index"</span> <span
class="p">\</span></font></div><div
class="line" id="LC57"><font
color="#999999"> <span
class="k">if</span> <span
class="n">this_user</span><span
class="o">.</span><span
class="n">admin?</span> <span
class="cp">%></span> <span
class="c"><!--</span></font></div><div
class="line" id="LC58"><font
color="#999999"><span class="c">
</span><span class="cp"><%=</span> <span
class="n">link_to</span> <span
class="s2">"News"</span><span
class="p">,</span> <span
class="ss">:controller</span> <span
class="o">=></span> <
span class="s2">"news"</span><span
class="p">,</span> <span
class="ss">:action</span> <span
class="o">=></span> <span
class="s2">"index"</span> <span
class="p">\</span></font></div><div
class="line" id="LC59"><font
color="#999999"> <span
class="k">if</span> <span
class="n">this_user</span><span
class="o">.</span><span
class="n">admin?</span> <span
class="cp">%></span><span class="c">
--></span></font></div><div class="line"
id="LC60"><font
color="#999999"> <span
class="cp"><%=</span> <span
class="n">link_to</span> <span
class="s2">"Timetable"</span><span
class="p">,</span> <span
class="ss">:controller</span> <span
class="o">=></span> <span
class="s2">"timetable"</span><span
class="p">,</span> <span
class="ss">:action</span> <span
class="o">=></span> <span
class="s2">"index"</span> <span
class="p">\</span></font></div><div
class="l
ine" id="LC61"><font
color="#999999"> <span
class="k">if</span> <span
class="n">this_user</span><span
class="o">.</span><span
class="n">admin?</span> <span
class="cp">%></span></font></div><div
class="line" id="LC62"><font
color="#999999"> <span
class="cp"><%</span> <span
class="k">if</span> <span
class="n">this_user</span><span
class="o">.</span><span
class="n">admin?</span> <span
class="cp">%></span></font></div><div
class="line" id="LC63"><font
color="#999999"> <span
class="nt"><a</span> <span
class="na">href=</span><span
class="s">"#"</span> <span
class="na">class=</span><span
class="s">"menuanchorclass"</span> <span
class="na">rel=</span><span
class="s">"anylinkmenu1"</span><span
class="nt">></span>More ▼<span
class="nt"></a></span></font></div><d
iv class="line" id="LC64"><font
color="#999999"> <span
class="cp"><%</span> <span
class="k">end</span> <span
class="cp">%></span></font></div><div
class="line" id="LC65"><font
color="#999999">
</font></div><div class="line"
id="LC66"><font
color="#999999"> <span
class="nt"></div></span></font></div></pre>
<br>
An easy solution will be (same menu
everywhere), change the CSS
of "main-menu" and creating "sidebar_menu" and
some code like this:<br>
<pre><font color="#999999"> <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></font></pre>
<br>
No need of partial or magic ROR... just HTML
and CSS.<br>
<br>
Greetings, <br>
<br>
El 16/08/2011 15:25, hanish jadala escribió:
<blockquote
cite="mid:CAOKUzCnPwtmPnaSrwvNLkP2NrOyxO90D9BD2bu2f64rK68EEvg-JsoAwUIsXotQFR93xxRIaA@public.gmane.orgcom"
type="cite"> 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.
-- <br>
You received this message because you are subscribed to the Google
Groups "Ruby on Rails: Talk" group.<br>
To post to this group, send email to
<a class="moz-txt-link-abbreviated"
href="mailto:rubyonrails-talk@googlegroups.com">rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org</a>.<br>
To unsubscribe from this group, send email to
<a class="moz-txt-link-abbreviated"
href="mailto:rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org">rubyonrails-talk+unsubscribe-/JYPxA39Uh4Ykp1iOSErHA@public.gmane.orgm</a>.<br>
For more options, visit this group at
<a class="moz-txt-link-freetext"
href="http://groups.google.com/group/rubyonrails-talk?hl=en">http://groups.google.com/group/rubyonrails-talk?hl=en</a>.<br>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Miquel Cubel Escarré
+34 699 73 22 46
<a class="moz-txt-link-abbreviated"
href="mailto:mcubel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org">mcubel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org</a>
"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.</pre>
</body>
</html>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.<br />
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org<br />
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe@googlegroups.com.<br />
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.<br />