From 5b8af6bc41faf96972396a5b8455630157ea6935 Mon Sep 17 00:00:00 2001 From: Ahmet Sezgin Duran Date: Fri, 3 Jan 2014 09:34:15 +0200 Subject: [PATCH] #2 Clean up controller --- app/controllers/kebapage/static_pages_controller.rb | 9 --------- config/routes.rb | 1 + 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/app/controllers/kebapage/static_pages_controller.rb b/app/controllers/kebapage/static_pages_controller.rb index 7354942..7bf72b1 100644 --- a/app/controllers/kebapage/static_pages_controller.rb +++ b/app/controllers/kebapage/static_pages_controller.rb @@ -4,25 +4,20 @@ module Kebapage class StaticPagesController < ApplicationController before_action :set_static_page, only: [:show, :edit, :update, :destroy] - # GET /static_pages def index @static_pages = StaticPage.all end - # GET /static_pages/1 def show end - # GET /static_pages/new def new @static_page = StaticPage.new end - # GET /static_pages/1/edit def edit end - # POST /static_pages def create @static_page = StaticPage.new(static_page_params) @@ -33,7 +28,6 @@ def create end end - # PATCH/PUT /static_pages/1 def update if @static_page.update(static_page_params) redirect_to @static_page, notice: 'Static page was successfully updated.' @@ -42,19 +36,16 @@ def update end end - # DELETE /static_pages/1 def destroy @static_page.destroy redirect_to static_pages_url, notice: 'Static page was successfully destroyed.' end private - # Use callbacks to share common setup or constraints between actions. def set_static_page @static_page = StaticPage.find(params[:id]) end - # Only allow a trusted parameter "white list" through. def static_page_params params.require(:static_page).permit(:title, :content) end diff --git a/config/routes.rb b/config/routes.rb index 9210c21..e488582 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,3 +1,4 @@ Kebapage::Engine.routes.draw do resources :static_pages + root 'static_pages#index' end