aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/snippets_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/snippets_controller.rb')
-rw-r--r--app/controllers/snippets_controller.rb30
1 files changed, 1 insertions, 29 deletions
diff --git a/app/controllers/snippets_controller.rb b/app/controllers/snippets_controller.rb
index 7d6f1b3..6fe26b1 100644
--- a/app/controllers/snippets_controller.rb
+++ b/app/controllers/snippets_controller.rb
@@ -1,12 +1,6 @@
class SnippetsController < ApplicationController
before_action :set_snippet, only: [:show]
- # GET /snippets
- # TODO
- # def index
- # @snippets = Snippet.all
- # end
-
# GET /1234
def show
end
@@ -16,11 +10,6 @@ class SnippetsController < ApplicationController
@snippet = Snippet.new
end
- # GET /snippets/1/edit
- # TODO
- # def edit
- # end
-
# POST /create
def create
@snippet = Snippet.new(snippet_params)
@@ -32,23 +21,6 @@ class SnippetsController < ApplicationController
end
end
- # PATCH/PUT /snippets/1
- # TODO
- # def update
- # if @snippet.update(snippet_params)
- # redirect_to @snippet, notice: "Snippet was successfully updated."
- # else
- # render :edit
- # end
- # end
-
- # DELETE /snippets/1
- # TODO
- # def destroy
- # @snippet.destroy
- # redirect_to snippets_url, notice: "Snippet was successfully destroyed."
- # end
-
private
# Use callbacks to share common setup or constraints between actions.
def set_snippet
@@ -57,6 +29,6 @@ class SnippetsController < ApplicationController
# Only allow a trusted parameter "white list" through.
def snippet_params
- params.require(:snippet).permit(:title, :code)
+ params.require(:snippet).permit(:title, :code, :language)
end
end