summaryrefslogtreecommitdiff
path: root/app/controllers/tutorials_controller.rb
diff options
context:
space:
mode:
authormo k <mo@mokhan.ca>2013-02-09 22:11:16 -0700
committermo k <mo@mokhan.ca>2013-02-09 22:11:16 -0700
commitd79548f2a45f4362b094a6c5962e3e0ee5ed4dd9 (patch)
treeb96e4fb6221a92a698f6e87162f421f4c63e5a06 /app/controllers/tutorials_controller.rb
parentc6dff27db0d7d7ffbdc22a3fedf3c1e7d4ffcbb0 (diff)
if there is an error creating a tutorial then load the user to be able to render the view template
Diffstat (limited to 'app/controllers/tutorials_controller.rb')
-rw-r--r--app/controllers/tutorials_controller.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/app/controllers/tutorials_controller.rb b/app/controllers/tutorials_controller.rb
index 5c57056b..3901832b 100644
--- a/app/controllers/tutorials_controller.rb
+++ b/app/controllers/tutorials_controller.rb
@@ -25,6 +25,7 @@ class TutorialsController < ApplicationController
if @tutorial.save
format.html { redirect_to( '/tutorials', :notice => 'the tutorial was successfully added.' ) }
else
+ @user = current_user
flash[:error] = @tutorial.errors.full_messages
format.html { render :action => "new" }
end