Displaying view when using :order in find

I have a model entity called Project that can have one of three priority
states: high (1), medium (2), low (3). What I want to do is show all
ongoing projects from high – low priority.

#controller
@projects = Project.find(:all, :conditions => [“status = ‘ongoing’”],
:order => “priority asc”)

My view looks like this:

<% unless @projects.empty? %> <%= render(:partial => "project", :collection => @projects) %> <% else %>

No projects have been created yet.

<% end %>

The _project partial simply spits out the details for an individual
project. So how do I display projects like this:

  1. High Priority
    — list of high projects
  2. Medium Priority
    — list of medium priority projects
  3. Low Priority
    — list of low priority projects

Thanks for the help!

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs