Left menu for Fedena Project

i wanna add left menu in the 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.

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:

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.

On 16 August 2011 13:41, hanish jadala [email protected]
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

On 16 August 2011 13:57, hanish jadala [email protected]
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 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

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.

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 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

Hi,

    Assuming the code is the same as "https://github.com/projectfedena/projectfedena_v2.0"

    You can find the upper menu embedded in "/app/views/layouts/application.html.erb"

        <div id="main-menu">
          <%= link_to "Dashboard", :controller => "user", :action => "dashboard" %>
          <% this_user = User.find(session[:user_id]) if session[:user_id] %>
          <% if this_user.student? || this_user.employee? %>
            <%= link_to "Calendar", :controller => "calendar" %>
          <% end %>
          <%= link_to "Students", :controller => "student", :action => "index" \
            if this_user.admin? %>
          <%= link_to "Attendance", :controller => "student_attendance", :action => "index" \
            if this_user.admin? %>
   &nbsp ;      <%= link_to "Settings", :controller => "configuration", :action => "index" \
            if this_user.admin? %> <!--
<%= link_to "News", :controller => < span class="s2">"news", :action => "index" \
            if this_user.admin? %> -->
          <%= link_to "Timetable", :controller => "timetable", :action => "index" \
            if this_user.admin? %>
          <% if this_user.admin? %>
            <a href="#" class="menuanchorclass" rel="anylinkmenu1">More ▼</a>
          <% end %>
        </div>

    An easy solution will be (same menu everywhere), change the CSS of "main-menu" and creating "sidebar_menu"  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>

    No need of partial or magic ROR... just HTML and CSS.

    Greetings,

El 16/08/2011 15:25, hanish jadala escribió:
 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. --
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 [email protected].
To unsubscribe from this group, send email to [email protected].
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

--
Miquel C. Escarré
+34 699 73 22 46
[email protected]

“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
[email protected].

To unsubscribe from this group, send email to
[email protected].

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