diff --git a/app/controllers/habits_controller.rb b/app/controllers/habits_controller.rb
index ce98500714..86f693a520 100644
--- a/app/controllers/habits_controller.rb
+++ b/app/controllers/habits_controller.rb
@@ -56,7 +56,7 @@ class HabitsController < ApplicationController
respond_to do |format|
if @habit.update_attributes(params[:habit])
- format.html { redirect_to @habit, notice: 'Habit was successfully updated.' }
+ format.html { redirect_to habits_url, notice: 'Habit was successfully updated.' }
format.json { head :no_content }
else
format.html { render action: "edit" }
diff --git a/app/views/habits/_habit.html.erb b/app/views/habits/_habit.html.erb
index a9a76a0c15..f228b493b6 100644
--- a/app/views/habits/_habit.html.erb
+++ b/app/views/habits/_habit.html.erb
@@ -9,7 +9,7 @@
when s>=5 && s<15 then score = 'good'
when s>=15 then score = 'done'
end
- name = "#{habit.name}"
+ name = "#{h(habit.name)}"
%>