diff --git a/app/controllers/habits_controller.rb b/app/controllers/habits_controller.rb
index 2e5ff7862e..ce98500714 100644
--- a/app/controllers/habits_controller.rb
+++ b/app/controllers/habits_controller.rb
@@ -19,7 +19,7 @@ class HabitsController < ApplicationController
# GET /habits/new.json
def new
@habit = Habit.new
- @habit.weight = Habit.maximum('weight') + 1
+ @habit.position = (Habit.maximum('position') || 0) + 1
respond_to do |format|
format.html # new.html.erb
diff --git a/app/models/habit.rb b/app/models/habit.rb
index 69640c81ac..14a2cec3c4 100644
--- a/app/models/habit.rb
+++ b/app/models/habit.rb
@@ -5,6 +5,8 @@ class Habit < ActiveRecord::Base
belongs_to :user
+ default_scope :order => 'position ASC'
+
# TODO set cron for this
def self.clear_done
Habit.where(:habit_type => Habit::DAILY).collect do |h|
diff --git a/app/views/habits/_form.html.erb b/app/views/habits/_form.html.erb
index 89f0f40fc6..a5b4a55b8b 100644
--- a/app/views/habits/_form.html.erb
+++ b/app/views/habits/_form.html.erb
@@ -23,14 +23,6 @@
<%= f.label :notes %>
<%= f.text_area :notes %>
-