diff --git a/app/controllers/categories_controller.rb b/app/controllers/categories_controller.rb index 380d13e..23f0f07 100755 --- a/app/controllers/categories_controller.rb +++ b/app/controllers/categories_controller.rb @@ -1,5 +1,7 @@ class CategoriesController < ApplicationController load_and_authorize_resource :category + + before_filter :check_for_cancel def create if @category.save @@ -23,4 +25,10 @@ class CategoriesController < ApplicationController redirect_to forums_url end end -end \ No newline at end of file + + def check_for_cancel + if params[:commit] == 'cancel' + redirect_to forums_path + end + end +end diff --git a/app/views/categories/_form.html.erb b/app/views/categories/_form.html.erb index 6969a61..555d416 100755 --- a/app/views/categories/_form.html.erb +++ b/app/views/categories/_form.html.erb @@ -6,33 +6,17 @@ <% if @category.errors.any? %> <% flash.now[:error] = @category.errors.full_messages.join(', and ') %> <% end %> -