From 502b44d703cba05f702f013f9a3580131b551f8e Mon Sep 17 00:00:00 2001 From: Tyler Renelle Date: Sat, 4 Feb 2012 17:50:06 -0500 Subject: [PATCH] reward view bugs --- app/controllers/rewards_controller.rb | 4 ++-- app/views/rewards/edit.html.erb | 3 +-- app/views/rewards/new.html.erb | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/app/controllers/rewards_controller.rb b/app/controllers/rewards_controller.rb index ff25997c4f..e73ec876f6 100644 --- a/app/controllers/rewards_controller.rb +++ b/app/controllers/rewards_controller.rb @@ -14,7 +14,7 @@ class RewardsController < ApplicationController # GET /rewards/1/edit def edit - @reward.user_id = current_user.id + @reward = current_user.rewards.find(params[:id]) end # POST /rewards @@ -37,7 +37,7 @@ class RewardsController < ApplicationController # PUT /rewards/1 # PUT /rewards/1.json def update - @reward = curren_user.rewards.find(params[:id]) + @reward = current_user.rewards.find(params[:id]) respond_to do |format| if @reward.update_attributes(params[:reward]) diff --git a/app/views/rewards/edit.html.erb b/app/views/rewards/edit.html.erb index 93e2b4d8bc..dbfcff6bb3 100644 --- a/app/views/rewards/edit.html.erb +++ b/app/views/rewards/edit.html.erb @@ -2,5 +2,4 @@ <%= render 'form' %> -<%= link_to 'Show', @reward %> | -<%= link_to 'Back', rewards_path %> +<%= link_to 'Back', habits_path %> diff --git a/app/views/rewards/new.html.erb b/app/views/rewards/new.html.erb index 91b7a7a41b..64025c3a40 100644 --- a/app/views/rewards/new.html.erb +++ b/app/views/rewards/new.html.erb @@ -2,4 +2,4 @@ <%= render 'form' %> -<%= link_to 'Back', rewards_path %> +<%= link_to 'Back', habits_path %>