Browse files

Misc stuff

  • Loading branch information...
1 parent eb1ff50 commit 4815fd37da052a2c6da2c4dbe0acb73dec664456 @iain committed Jan 15, 2012
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

0 comments on commit 4815fd3

Please sign in to comment.