]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/redactions_controller.rb
Added redactions controller test and fixed a bug in the controller
[rails.git] / app / controllers / redactions_controller.rb
index 201f1883f1abe8e609e7b4ace7b48989b314206b..03324ad8f30cb0fdcd0b143929c1ef452b8835a8 100644 (file)
@@ -19,7 +19,7 @@ class RedactionsController < ApplicationController
      
   def create
     @redaction = Redaction.new
      
   def create
     @redaction = Redaction.new
-    @redaction.user_id = @user.id
+    @redaction.user = @user
     @redaction.title = params[:redaction][:title]
     @redaction.description = params[:redaction][:description]
     # didn't see this come in from the form - maybe i'm doing something
     @redaction.title = params[:redaction][:title]
     @redaction.description = params[:redaction][:description]
     # didn't see this come in from the form - maybe i'm doing something
@@ -68,7 +68,7 @@ class RedactionsController < ApplicationController
     else
       if @redaction.destroy
         flash[:notice] = t('redaction.destroy.flash')
     else
       if @redaction.destroy
         flash[:notice] = t('redaction.destroy.flash')
-        redirect_to :index
+        redirect_to :redactions
       else
         flash[:error] = t('redaction.destroy.error')
         redirect_to @redaction
       else
         flash[:error] = t('redaction.destroy.error')
         redirect_to @redaction