From e47e83cf6bded3d1924b4d500193e7876833ef83 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Sun, 2 Jul 2017 13:03:43 -0400 Subject: Created admin panel Currently allows you to create and edit blogs, including associated records. Uses a WYSIWYG editor that allows uploading images. Also included jQuery :( --- app/controllers/entries_controller.rb | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) (limited to 'app/controllers/entries_controller.rb') diff --git a/app/controllers/entries_controller.rb b/app/controllers/entries_controller.rb index 366de53..14d779a 100644 --- a/app/controllers/entries_controller.rb +++ b/app/controllers/entries_controller.rb @@ -1,26 +1,7 @@ class EntriesController < ApplicationController - before_action :authenticate_user!, only: [:edit, :update] def show - @entry = Entry.where(slug: params[:slug]).first + @entry = Entry.find_by_slug(params[:slug]) end - def edit - @entry = Entry.where(slug: params[:slug]).first - end - - def update - @entry = Entry.where(slug: params[:slug]).first - - if @entry.update_attributes(entry_params) - flash.notice = "" - end - end - - private - - def entry_params - params.require(:blog).permit(:title, :body, :slug) - end - end -- cgit 1.4.1