Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Misc stuff

  • Loading branch information...
commit 4815fd37da052a2c6da2c4dbe0acb73dec664456 1 parent eb1ff50
@iain authored
View
2  app/controllers/application_controller.rb
@@ -2,7 +2,7 @@ class ApplicationController < ActionController::Base
protect_from_forgery
def projects
- @projects ||= Project.all
+ @projects ||= Project.list
end
helper_method :projects
View
4 app/models/project.rb
@@ -6,4 +6,8 @@ class Project < ActiveRecord::Base
validates_presence_of :name
validates_uniqueness_of :name
+ def self.list
+ order(:name)
+ end
+
end
View
3  app/views/projects/index.html.haml
@@ -1,3 +1,6 @@
+:javascript
+ activateNavigation("index");
+
%h2 Projects
%table.projects
View
2  app/views/shared/_navigation.html.haml
@@ -1,6 +1,6 @@
%ul.nav.secondary-nav{data("dropdown")}
- %li.dropdown
+ %li.dropdown.project_nav#project_nav_index
= link_to "Projects", projects_path, :class => "dropdown-toggle"
View
2  spec/controllers/application_controller_spec.rb
@@ -5,7 +5,7 @@
describe "#projects" do
it "gets all projects" do
- Project.should_receive(:all)
+ Project.should_receive(:list)
controller.projects
end
Please sign in to comment.
Something went wrong with that request. Please try again.