summaryrefslogtreecommitdiff
path: root/app/controllers/tutorials_controller.rb
diff options
context:
space:
mode:
authormo k <mo@mokhan.ca>2012-09-17 20:53:58 -0600
committermo k <mo@mokhan.ca>2012-09-17 20:53:58 -0600
commitf7f1d9d38d6f121b6f6a8ba237b6da36664a020f (patch)
treee9d7035d68002370e8fe612806d0851b97e9b85d /app/controllers/tutorials_controller.rb
parent544cb63581905a862a06ed1bd587d709e7c14107 (diff)
save tags added to a tutorial and display the tags on the tutorials page.
Diffstat (limited to 'app/controllers/tutorials_controller.rb')
-rw-r--r--app/controllers/tutorials_controller.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/app/controllers/tutorials_controller.rb b/app/controllers/tutorials_controller.rb
index 5e932253..bcf5cdd6 100644
--- a/app/controllers/tutorials_controller.rb
+++ b/app/controllers/tutorials_controller.rb
@@ -19,10 +19,10 @@ class TutorialsController < ApplicationController
def create
@tutorial = current_user.tutorials.create(params[:tutorial])
- current_user.tag(@tutorial, :with => params[:tutorial][:tags], :on => :tags)
+ current_user.tag(@tutorial, :with => params[:tutorial_tags], :on => :tags)
respond_to do |format|
if @tutorial.save
- format.html { redirect_to( '/tutorials' ) }
+ format.html { redirect_to( '/tutorials', :notice => 'the tutorial was successfully added.' ) }
else
flash[:error] = @tutorial.errors.full_messages
format.html { render :action => "new" }
@@ -32,10 +32,10 @@ class TutorialsController < ApplicationController
def update
@tutorial = current_user.tutorials.find(params[:id])
-
+ current_user.tag(@tutorial, :with => params[:tutorial_tags], :on => :tags)
respond_to do |format|
if @tutorial.update_attributes(params[:tutorial])
- format.html { redirect_to(@tutorial, :notice => 'tutorial was successfully updated.') }
+ format.html { redirect_to(@tutorial, :notice => 'the tutorial was successfully updated.') }
else
format.html { render :action => "edit" }
end