summaryrefslogtreecommitdiff
path: root/app/controllers/tutorials_controller.rb
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2014-08-27 20:41:25 -0600
committermo khan <mo@mokhan.ca>2014-08-27 20:41:25 -0600
commitc6324be510fea95ff6af956fc5b93e59672d0eae (patch)
tree3f7faee2716bd2a77ecfe2fe3c11650497a6d80b /app/controllers/tutorials_controller.rb
parent227882b0758c7918537cbdb7c49ad8fcf09d6ae5 (diff)
remove old tutorial actions.
Diffstat (limited to 'app/controllers/tutorials_controller.rb')
-rw-r--r--app/controllers/tutorials_controller.rb42
1 files changed, 0 insertions, 42 deletions
diff --git a/app/controllers/tutorials_controller.rb b/app/controllers/tutorials_controller.rb
index 7c88460e..2c7a9a2f 100644
--- a/app/controllers/tutorials_controller.rb
+++ b/app/controllers/tutorials_controller.rb
@@ -1,6 +1,4 @@
class TutorialsController < ApplicationController
- before_filter :authenticate!, :except => [:show, :index]
-
def index
@tutorials = Tutorial.includes(:tags).page(params[:page]).per(15)
end
@@ -8,44 +6,4 @@ class TutorialsController < ApplicationController
def show
@tutorial = Tutorial.find(params[:id])
end
-
- def new
- @tutorial = Tutorial.new
- @user = current_user
- end
-
- def edit
- @tutorial = current_user.tutorials.find(params[:id])
- end
-
- def create
- @tutorial = current_user.tutorials.create(tutorial_params)
- current_user.tag(@tutorial, :with => params[:tutorial_tags], :on => :tags)
- if @tutorial.save
- redirect_to my_dashboard_path, :notice => t(:tutorial_saved)
- else
- flash[:error] = @tutorial.errors.full_messages
- render :new
- end
- end
-
- def update
- @tutorial = current_user.tutorials.find(params[:id])
- current_user.tag(@tutorial, :with => params[:tutorial_tags], :on => :tags)
- if @tutorial.update_attributes(tutorial_params)
- redirect_to @tutorial
- else
- render :edit
- end
- end
-
- def destroy
- @tutorial = current_user.tutorials.find(params[:id])
- @tutorial.destroy
- redirect_to my_dashboard_path
- end
-
- def tutorial_params
- params.require(:tutorial).permit(:url, :heading)
- end
end