From 9a5163ff9814d85273080d71e2c43ad428440699 Mon Sep 17 00:00:00 2001 From: Tim Glen Date: Wed, 26 Aug 2015 12:51:42 -0400 Subject: [PATCH] Built Content Resources so they show up in Smithy navigation --- ...ler.rb => content_resources_controller.rb} | 4 +- app/views/layouts/smithy/shared/_nav.html.erb | 3 ++ .../edit.html.erb | 0 .../index.html.erb | 0 .../new.html.erb | 0 lib/smithy.rb | 3 +- lib/smithy/content_pieces/registry.rb | 39 ------------------- lib/smithy/content_resources.rb | 2 + .../base.rb | 4 +- lib/smithy/content_resources/registry.rb | 31 +++++++++++++++ 10 files changed, 41 insertions(+), 45 deletions(-) rename app/controllers/smithy/{content_pieces_controller.rb => content_resources_controller.rb} (92%) rename app/views/smithy/{content_pieces => content_resources}/edit.html.erb (100%) rename app/views/smithy/{content_pieces => content_resources}/index.html.erb (100%) rename app/views/smithy/{content_pieces => content_resources}/new.html.erb (100%) delete mode 100644 lib/smithy/content_pieces/registry.rb create mode 100644 lib/smithy/content_resources.rb rename lib/smithy/{content_pieces => content_resources}/base.rb (57%) create mode 100644 lib/smithy/content_resources/registry.rb diff --git a/app/controllers/smithy/content_pieces_controller.rb b/app/controllers/smithy/content_resources_controller.rb similarity index 92% rename from app/controllers/smithy/content_pieces_controller.rb rename to app/controllers/smithy/content_resources_controller.rb index 7318ad4..5942766 100644 --- a/app/controllers/smithy/content_pieces_controller.rb +++ b/app/controllers/smithy/content_resources_controller.rb @@ -1,6 +1,6 @@ require_dependency "smithy/base_controller" -class Smithy::ContentPiecesController < Smithy::BaseController +class Smithy::ContentResourcesController < Smithy::BaseController before_filter :set_controller_path respond_to :html, :json @@ -56,7 +56,7 @@ def destroy private def klass # override to provide an object for each class - raise "You must inherit from this Smithy::ContentPiecesController and provide a private #klass method" + raise "You must inherit from this Smithy::ContentResourcesController and provide a private #klass method" end def klass_name diff --git a/app/views/layouts/smithy/shared/_nav.html.erb b/app/views/layouts/smithy/shared/_nav.html.erb index 299fc7b..caf8ed9 100644 --- a/app/views/layouts/smithy/shared/_nav.html.erb +++ b/app/views/layouts/smithy/shared/_nav.html.erb @@ -14,6 +14,9 @@