knowledge_base 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/Rakefile +28 -0
- data/app/assets/javascripts/knowledge_base/application.js +13 -0
- data/app/assets/stylesheets/knowledge_base/application.css +15 -0
- data/app/controllers/knowledge_base/application_controller.rb +4 -0
- data/app/controllers/knowledge_base/articles_controller.rb +17 -0
- data/app/controllers/knowledge_base/categories_controller.rb +13 -0
- data/app/helpers/knowledge_base/application_helper.rb +4 -0
- data/app/models/knowledge_base/article.rb +13 -0
- data/app/models/knowledge_base/category.rb +16 -0
- data/app/models/knowledge_base/category_article_association.rb +6 -0
- data/app/models/knowledge_base/section.rb +9 -0
- data/app/models/knowledge_base/sectionables.rb +7 -0
- data/app/models/knowledge_base/sectionables/gallery.rb +5 -0
- data/app/models/knowledge_base/sectionables/gallery/image.rb +7 -0
- data/app/models/knowledge_base/sectionables/image.rb +5 -0
- data/app/models/knowledge_base/sectionables/links.rb +5 -0
- data/app/models/knowledge_base/sectionables/links/link.rb +10 -0
- data/app/models/knowledge_base/sectionables/list.rb +5 -0
- data/app/models/knowledge_base/sectionables/list/item.rb +5 -0
- data/app/models/knowledge_base/sectionables/text.rb +4 -0
- data/app/models/knowledge_base/sectionables/video.rb +9 -0
- data/app/uploaders/knowledge_base/image_uploader.rb +53 -0
- data/app/views/knowledge_base/articles/show.html.erb +11 -0
- data/app/views/knowledge_base/categories/index.html.erb +11 -0
- data/app/views/knowledge_base/categories/show.html.erb +15 -0
- data/app/views/knowledge_base/sectionables/galleries/_gallery.html.erb +17 -0
- data/app/views/knowledge_base/sectionables/images/_image.html.erb +5 -0
- data/app/views/knowledge_base/sectionables/links/_links.html.erb +5 -0
- data/app/views/knowledge_base/sectionables/lists/_list.html.erb +17 -0
- data/app/views/knowledge_base/sectionables/texts/_text.html.erb +9 -0
- data/app/views/knowledge_base/sectionables/videos/_video.html.erb +1 -0
- data/app/views/layouts/knowledge_base/application.html.erb +14 -0
- data/config/routes.rb +5 -0
- data/db/migrate/20140303102920_create_knowledge_base_categories.rb +16 -0
- data/db/migrate/20140303152945_create_knowledge_base_articles.rb +13 -0
- data/db/migrate/20140305134249_create_knowledge_base_sections.rb +13 -0
- data/db/migrate/20140306103853_create_knowledge_base_sectionables_texts.rb +11 -0
- data/db/migrate/20140306123236_create_knowledge_base_sectionables_images.rb +10 -0
- data/db/migrate/20140306134124_add_article_id_to_sections.rb +7 -0
- data/db/migrate/20140306134616_remove_kind_from_sections.rb +5 -0
- data/db/migrate/20140306162143_polymorphize_sections.rb +11 -0
- data/db/migrate/20140306181906_create_knowledge_base_sectionables_videos.rb +9 -0
- data/db/migrate/20140306194339_create_knowledge_base_sectionables_galleries.rb +10 -0
- data/db/migrate/20140306194600_create_knowledge_base_sectionables_gallery_images.rb +12 -0
- data/db/migrate/20140306200631_create_knowledge_base_sectionables_lists.rb +10 -0
- data/db/migrate/20140306210259_create_knowledge_base_sectionables_list_items.rb +12 -0
- data/db/migrate/20140307080616_create_knowledge_base_category_article_associations.rb +16 -0
- data/db/migrate/20140307092627_create_knowledge_base_sectionables_links.rb +8 -0
- data/db/migrate/20140307092719_create_knowledge_base_sectionables_links_links.rb +12 -0
- data/lib/knowledge_base.rb +15 -0
- data/lib/knowledge_base/configuration.rb +5 -0
- data/lib/knowledge_base/engine.rb +15 -0
- data/lib/knowledge_base/version.rb +3 -0
- data/lib/tasks/knowledge_base_tasks.rake +4 -0
- data/spec/controllers/knowledge_base/articles_controller_spec.rb +20 -0
- data/spec/controllers/knowledge_base/categories_controller_spec.rb +25 -0
- data/spec/dummy/README.rdoc +28 -0
- data/spec/dummy/Rakefile +6 -0
- data/spec/dummy/app/assets/javascripts/application.js +13 -0
- data/spec/dummy/app/assets/stylesheets/application.css +15 -0
- data/spec/dummy/app/controllers/application_controller.rb +5 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/bin/bundle +3 -0
- data/spec/dummy/bin/rails +4 -0
- data/spec/dummy/bin/rake +4 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/config/application.rb +23 -0
- data/spec/dummy/config/boot.rb +5 -0
- data/spec/dummy/config/database.yml +30 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +37 -0
- data/spec/dummy/config/environments/production.rb +83 -0
- data/spec/dummy/config/environments/test.rb +39 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/spec/dummy/config/initializers/inflections.rb +16 -0
- data/spec/dummy/config/initializers/mime_types.rb +5 -0
- data/spec/dummy/config/initializers/session_store.rb +3 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +23 -0
- data/spec/dummy/config/routes.rb +4 -0
- data/spec/dummy/config/secrets.yml +22 -0
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/schema.rb +134 -0
- data/spec/dummy/db/seeds.rb +28 -0
- data/spec/dummy/log/development.log +12030 -0
- data/spec/dummy/log/test.log +917 -0
- data/spec/dummy/public/404.html +67 -0
- data/spec/dummy/public/422.html +67 -0
- data/spec/dummy/public/500.html +66 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/public/uploads/knowledge_base/sectionables/gallery/image/image/1/parrot.png +0 -0
- data/spec/dummy/public/uploads/knowledge_base/sectionables/gallery/image/image/2/parrot.png +0 -0
- data/spec/dummy/public/uploads/knowledge_base/sectionables/image/image/1/parrot.png +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/062b47a3a70e4df7224b893bf001a98f +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/183c0bd4fe8641adfc2b9f735484664a +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/2f86727a5dfdf38270057bb8a6b140bc +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/32c50a0141ffd19eb481b35a22532865 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/806fae72d2de8ab235cdf1503e8c950b +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/e9c371dd2bf884ad2ab7c34915daf486 +0 -0
- data/spec/dummy/tmp/pids/server.pid +1 -0
- data/spec/factories/knowledge_base_articles.rb +9 -0
- data/spec/factories/knowledge_base_categories.rb +10 -0
- data/spec/factories/knowledge_base_category_article_associations.rb +9 -0
- data/spec/factories/knowledge_base_sectionables_galleries.rb +8 -0
- data/spec/factories/knowledge_base_sectionables_gallery_images.rb +10 -0
- data/spec/factories/knowledge_base_sectionables_images.rb +8 -0
- data/spec/factories/knowledge_base_sectionables_links.rb +6 -0
- data/spec/factories/knowledge_base_sectionables_links_links.rb +9 -0
- data/spec/factories/knowledge_base_sectionables_list_items.rb +10 -0
- data/spec/factories/knowledge_base_sectionables_lists.rb +8 -0
- data/spec/factories/knowledge_base_sectionables_texts.rb +11 -0
- data/spec/factories/knowledge_base_sectionables_videos.rb +7 -0
- data/spec/factories/knowledge_base_sections.rb +9 -0
- data/spec/fixtures/parrot.png +0 -0
- data/spec/lib/knowledge_base/configuration_spec.rb +14 -0
- data/spec/models/knowledge_base/article_spec.rb +7 -0
- data/spec/models/knowledge_base/category_article_association_spec.rb +7 -0
- data/spec/models/knowledge_base/category_spec.rb +7 -0
- data/spec/models/knowledge_base/section_spec.rb +7 -0
- data/spec/models/knowledge_base/sectionables/gallery/image_spec.rb +7 -0
- data/spec/models/knowledge_base/sectionables/gallery_spec.rb +7 -0
- data/spec/models/knowledge_base/sectionables/image_spec.rb +7 -0
- data/spec/models/knowledge_base/sectionables/links/link_spec.rb +7 -0
- data/spec/models/knowledge_base/sectionables/links_spec.rb +7 -0
- data/spec/models/knowledge_base/sectionables/list/item_spec.rb +7 -0
- data/spec/models/knowledge_base/sectionables/list_spec.rb +7 -0
- data/spec/models/knowledge_base/sectionables/text_spec.rb +7 -0
- data/spec/models/knowledge_base/sectionables/video_spec.rb +13 -0
- data/spec/spec_helper.rb +20 -0
- data/spec/views/knowledge_base/articles/show.html.erb_spec.rb +5 -0
- data/spec/views/knowledge_base/categories/index.html.erb_spec.rb +5 -0
- data/spec/views/knowledge_base/categories/show.html.erb_spec.rb +5 -0
- metadata +375 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 38e4e16f46ef1177b0e10c1b766ef129cc048e1f
|
4
|
+
data.tar.gz: 67ee73a4192942beb16046819390f5a4a254ef64
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 2c2a9d4670ade1caeec6f06c3dd5c7951a77337703402d53762de1fc7f9022f5bcb32e5bef01444ead630c4b4b6ab4ffd27b24ca6c719edecf2e2e9d8f2bd239
|
7
|
+
data.tar.gz: 55ec149fc0c0ae60a07ad90b4861f68cbc76718f7ccdd3de8e0031f6d4c146802359a063f9ed8ae584f9f07abfd4d6a82123e7eb325d9627a2415b29c23d4b98
|
data/MIT-LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright 2014 YOURNAME
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
begin
|
2
|
+
require 'bundler/setup'
|
3
|
+
rescue LoadError
|
4
|
+
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
5
|
+
end
|
6
|
+
|
7
|
+
require 'rdoc/task'
|
8
|
+
|
9
|
+
RDoc::Task.new(:rdoc) do |rdoc|
|
10
|
+
rdoc.rdoc_dir = 'rdoc'
|
11
|
+
rdoc.title = 'Mingle'
|
12
|
+
rdoc.options << '--line-numbers'
|
13
|
+
rdoc.rdoc_files.include('README.rdoc')
|
14
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
15
|
+
end
|
16
|
+
|
17
|
+
APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__)
|
18
|
+
load 'rails/tasks/engine.rake'
|
19
|
+
|
20
|
+
Bundler::GemHelper.install_tasks
|
21
|
+
|
22
|
+
require 'rspec/core'
|
23
|
+
require 'rspec/core/rake_task'
|
24
|
+
|
25
|
+
desc 'Run all specs in spec directory (excluding plugin specs)'
|
26
|
+
RSpec::Core::RakeTask.new spec: 'app:db:test:prepare'
|
27
|
+
|
28
|
+
task default: :spec
|
@@ -0,0 +1,13 @@
|
|
1
|
+
// This is a manifest file that'll be compiled into application.js, which will include all the files
|
2
|
+
// listed below.
|
3
|
+
//
|
4
|
+
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
|
5
|
+
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
|
6
|
+
//
|
7
|
+
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
8
|
+
// compiled file.
|
9
|
+
//
|
10
|
+
// Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
|
11
|
+
// about supported directives.
|
12
|
+
//
|
13
|
+
//= require_tree .
|
@@ -0,0 +1,15 @@
|
|
1
|
+
/*
|
2
|
+
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
3
|
+
* listed below.
|
4
|
+
*
|
5
|
+
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
|
6
|
+
* or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
|
7
|
+
*
|
8
|
+
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
|
9
|
+
* compiled file so the styles you add here take precedence over styles defined in any styles
|
10
|
+
* defined in the other CSS/SCSS files in this directory. It is generally better to create a new
|
11
|
+
* file per style scope.
|
12
|
+
*
|
13
|
+
*= require_tree .
|
14
|
+
*= require_self
|
15
|
+
*/
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require_dependency "knowledge_base/application_controller"
|
2
|
+
|
3
|
+
module KnowledgeBase
|
4
|
+
class ArticlesController < ApplicationController
|
5
|
+
before_action :set_category
|
6
|
+
|
7
|
+
def show
|
8
|
+
@article = @category.articles.friendly.find params[:id]
|
9
|
+
end
|
10
|
+
|
11
|
+
private
|
12
|
+
|
13
|
+
def set_category
|
14
|
+
@category = Category.friendly.find params[:category_id]
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require_dependency "knowledge_base/application_controller"
|
2
|
+
|
3
|
+
module KnowledgeBase
|
4
|
+
class CategoriesController < ApplicationController
|
5
|
+
def index
|
6
|
+
@categories = Category.all
|
7
|
+
end
|
8
|
+
|
9
|
+
def show
|
10
|
+
@category = Category.friendly.find params[:id]
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
module KnowledgeBase
|
2
|
+
class Article < ActiveRecord::Base
|
3
|
+
extend FriendlyId
|
4
|
+
|
5
|
+
publishable
|
6
|
+
|
7
|
+
friendly_id :title, use: :slugged
|
8
|
+
|
9
|
+
has_many :category_article_associations
|
10
|
+
has_many :categories, through: :category_article_associations
|
11
|
+
has_many :sections, -> { order 'position ASC' }, as: :container
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module KnowledgeBase
|
2
|
+
class Category < ActiveRecord::Base
|
3
|
+
extend FriendlyId
|
4
|
+
|
5
|
+
publishable
|
6
|
+
|
7
|
+
friendly_id :title, use: :slugged
|
8
|
+
|
9
|
+
belongs_to :category
|
10
|
+
has_many :category_article_associations
|
11
|
+
has_many :articles, through: :category_article_associations
|
12
|
+
|
13
|
+
scope :root, -> { where parent_id: nil }
|
14
|
+
scope :published, -> { where published: true }
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
module KnowledgeBase
|
2
|
+
class Section < ActiveRecord::Base
|
3
|
+
# It sounds wrong that a section "belongs to" a sectionable, but we want the foreign
|
4
|
+
# key to be on this side and declaring `belongs_to` is the only way to do that.
|
5
|
+
belongs_to :sectionable, polymorphic: true
|
6
|
+
|
7
|
+
belongs_to :container, polymorphic: true
|
8
|
+
end
|
9
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
module KnowledgeBase
|
2
|
+
class Sectionables::Links::Link < ActiveRecord::Base
|
3
|
+
# ActiveRecord assumes our table will be called 'knowledge_base_sectionables_link_links'
|
4
|
+
# because it likes to singularize modules. 'Links' It is not a module, however, but rather
|
5
|
+
# a class that represents a collection of links.
|
6
|
+
self.table_name = 'knowledge_base_sectionables_links_links'
|
7
|
+
|
8
|
+
belongs_to :links
|
9
|
+
end
|
10
|
+
end
|
@@ -0,0 +1,53 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
module KnowledgeBase
|
4
|
+
class ImageUploader < CarrierWave::Uploader::Base
|
5
|
+
|
6
|
+
# Include RMagick or MiniMagick support:
|
7
|
+
# include CarrierWave::RMagick
|
8
|
+
# include CarrierWave::MiniMagick
|
9
|
+
|
10
|
+
# Choose what kind of storage to use for this uploader:
|
11
|
+
storage KnowledgeBase.config.storage
|
12
|
+
# storage :fog
|
13
|
+
|
14
|
+
# Override the directory where uploaded files will be stored.
|
15
|
+
# This is a sensible default for uploaders that are meant to be mounted:
|
16
|
+
def store_dir
|
17
|
+
"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
|
18
|
+
end
|
19
|
+
|
20
|
+
# Provide a default URL as a default if there hasn't been a file uploaded:
|
21
|
+
# def default_url
|
22
|
+
# # For Rails 3.1+ asset pipeline compatibility:
|
23
|
+
# # ActionController::Base.helpers.asset_path("fallback/" + [version_name, "default.png"].compact.join('_'))
|
24
|
+
#
|
25
|
+
# "/images/fallback/" + [version_name, "default.png"].compact.join('_')
|
26
|
+
# end
|
27
|
+
|
28
|
+
# Process files as they are uploaded:
|
29
|
+
# process :scale => [200, 300]
|
30
|
+
#
|
31
|
+
# def scale(width, height)
|
32
|
+
# # do something
|
33
|
+
# end
|
34
|
+
|
35
|
+
# Create different versions of your uploaded files:
|
36
|
+
# version :thumb do
|
37
|
+
# process :resize_to_fit => [50, 50]
|
38
|
+
# end
|
39
|
+
|
40
|
+
# Add a white list of extensions which are allowed to be uploaded.
|
41
|
+
# For images you might use something like this:
|
42
|
+
# def extension_white_list
|
43
|
+
# %w(jpg jpeg gif png)
|
44
|
+
# end
|
45
|
+
|
46
|
+
# Override the filename of the uploaded files:
|
47
|
+
# Avoid using model.id or version_name here, see uploader/store.rb for details.
|
48
|
+
# def filename
|
49
|
+
# "something.jpg" if original_filename
|
50
|
+
# end
|
51
|
+
|
52
|
+
end
|
53
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<h1 class="title"><%= @article.title %></h1>
|
2
|
+
|
3
|
+
<div class="description">
|
4
|
+
<%= simple_format @article.description %>
|
5
|
+
|
6
|
+
<% @article.sections.each do |section| %>
|
7
|
+
<div class="<%= section.sectionable.class.name.demodulize.downcase %> section">
|
8
|
+
<%= render section.sectionable %>
|
9
|
+
</div>
|
10
|
+
<% end %>
|
11
|
+
</div>
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<h1>Categories</h1>
|
2
|
+
|
3
|
+
<div class="categories">
|
4
|
+
<% @categories.each do |category| %>
|
5
|
+
<div class="category">
|
6
|
+
<h2 class="title"><%= link_to category.title, category %></h2>
|
7
|
+
|
8
|
+
<div class="description"><%= simple_format category.description %></div>
|
9
|
+
</div>
|
10
|
+
<% end %>
|
11
|
+
</div>
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<h1 class="title"><%= @category.title %></h1>
|
2
|
+
|
3
|
+
<div class="description">
|
4
|
+
<%= simple_format @category.description %>
|
5
|
+
</div>
|
6
|
+
|
7
|
+
<div class="articles">
|
8
|
+
<% @category.articles.each do |article| %>
|
9
|
+
<div class="article">
|
10
|
+
<h2 class="title"><%= link_to article.title, category_article_path(@category, article) %></h2>
|
11
|
+
|
12
|
+
<div class="description"><%= simple_format article.description %></div>
|
13
|
+
</div>
|
14
|
+
<% end %>
|
15
|
+
</div>
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<h1 class="title"><%= gallery.title %></h1>
|
2
|
+
|
3
|
+
<div class="description">
|
4
|
+
<%= simple_format gallery.description %>
|
5
|
+
</div>
|
6
|
+
|
7
|
+
<div class="images">
|
8
|
+
<% gallery.images.each do |image| %>
|
9
|
+
<div class="image">
|
10
|
+
<%= image_tag image.image %>
|
11
|
+
|
12
|
+
<div class="caption">
|
13
|
+
<%= simple_format image.caption %>
|
14
|
+
</div>
|
15
|
+
</div>
|
16
|
+
<% end %>
|
17
|
+
</div>
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<h1 class="title"><%= list.title %></h1>
|
2
|
+
|
3
|
+
<div class="description">
|
4
|
+
<%= simple_format list.description %>
|
5
|
+
</div>
|
6
|
+
|
7
|
+
<ul class="items">
|
8
|
+
<% list.items.each do |item| %>
|
9
|
+
<li class="item">
|
10
|
+
<h2><%= item.title %></h2>
|
11
|
+
|
12
|
+
<div class="body">
|
13
|
+
<%= simple_format item.body %>
|
14
|
+
</div>
|
15
|
+
</li>
|
16
|
+
<% end %>
|
17
|
+
</div>
|
@@ -0,0 +1 @@
|
|
1
|
+
<iframe width="420" height="315" src="//www.youtube.com/embed/<%= video.youtube_id %>" frameborder="0" allowfullscreen></iframe>
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>KnowledgeBase</title>
|
5
|
+
<%= stylesheet_link_tag "knowledge_base/application", media: "all" %>
|
6
|
+
<%= javascript_include_tag "knowledge_base/application" %>
|
7
|
+
<%= csrf_meta_tags %>
|
8
|
+
</head>
|
9
|
+
<body>
|
10
|
+
|
11
|
+
<%= yield %>
|
12
|
+
|
13
|
+
</body>
|
14
|
+
</html>
|