From 588ad0c90025935a94362f2af5f05f621c58fb49 Mon Sep 17 00:00:00 2001 From: Tyler Renelle Date: Wed, 1 Feb 2012 19:41:22 +0000 Subject: [PATCH] Redirect update back to list, safely view habit name --- app/controllers/habits_controller.rb | 2 +- app/views/habits/_habit.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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)}" %>