From f7f1d9d38d6f121b6f6a8ba237b6da36664a020f Mon Sep 17 00:00:00 2001 From: mo k Date: Mon, 17 Sep 2012 20:53:58 -0600 Subject: save tags added to a tutorial and display the tags on the tutorials page. --- app/controllers/tutorials_controller.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'app/controllers/tutorials_controller.rb') 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 -- cgit v1.2.3