seo_pages 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.rdoc +34 -0
  4. data/Rakefile +34 -0
  5. data/app/assets/javascripts/seo/application.js +13 -0
  6. data/app/assets/javascripts/seo/seo_page_defaults.js +2 -0
  7. data/app/assets/javascripts/seo/seo_pages.js +2 -0
  8. data/app/assets/stylesheets/scaffold.css +56 -0
  9. data/app/assets/stylesheets/seo/application.css +24 -0
  10. data/app/assets/stylesheets/seo/seo_page_defaults.css +4 -0
  11. data/app/assets/stylesheets/seo/seo_pages.css +4 -0
  12. data/app/controllers/seo/application_controller.rb +6 -0
  13. data/app/controllers/seo/seo_page_defaults_controller.rb +62 -0
  14. data/app/controllers/seo/seo_pages_controller.rb +64 -0
  15. data/app/helpers/seo/application_helper.rb +16 -0
  16. data/app/helpers/seo/seo_page_defaults_helper.rb +4 -0
  17. data/app/helpers/seo/seo_pages_helper.rb +4 -0
  18. data/app/models/seo/seo_page.rb +5 -0
  19. data/app/models/seo/seo_page_default.rb +10 -0
  20. data/app/views/layouts/seo/application.html.erb +18 -0
  21. data/app/views/seo/seo_page_defaults/_form.html.erb +33 -0
  22. data/app/views/seo/seo_page_defaults/edit.html.erb +6 -0
  23. data/app/views/seo/seo_page_defaults/index.html.erb +27 -0
  24. data/app/views/seo/seo_page_defaults/new.html.erb +5 -0
  25. data/app/views/seo/seo_page_defaults/show.html.erb +19 -0
  26. data/app/views/seo/seo_pages/_form.html.erb +38 -0
  27. data/app/views/seo/seo_pages/edit.html.erb +6 -0
  28. data/app/views/seo/seo_pages/index.html.erb +44 -0
  29. data/app/views/seo/seo_pages/new.html.erb +5 -0
  30. data/app/views/seo/seo_pages/show.html.erb +24 -0
  31. data/config/routes.rb +7 -0
  32. data/db/migrate/20130903105348_create_seo_seo_pages.rb +12 -0
  33. data/db/migrate/20130903111044_create_seo_seo_page_defaults.rb +11 -0
  34. data/db/migrate/20130903123958_create_seo_page_default_record.rb +10 -0
  35. data/lib/seo/engine.rb +10 -0
  36. data/lib/seo/version.rb +3 -0
  37. data/lib/seo.rb +4 -0
  38. data/lib/tasks/seo_tasks.rake +4 -0
  39. data/test/controllers/seo/seo_page_defaults_controller_test.rb +51 -0
  40. data/test/controllers/seo/seo_pages_controller_test.rb +51 -0
  41. data/test/dummy/README.rdoc +28 -0
  42. data/test/dummy/Rakefile +6 -0
  43. data/test/dummy/app/assets/javascripts/application.js +13 -0
  44. data/test/dummy/app/assets/stylesheets/application.css +13 -0
  45. data/test/dummy/app/controllers/application_controller.rb +6 -0
  46. data/test/dummy/app/helpers/application_helper.rb +2 -0
  47. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  48. data/test/dummy/bin/bundle +3 -0
  49. data/test/dummy/bin/rails +4 -0
  50. data/test/dummy/bin/rake +4 -0
  51. data/test/dummy/config/application.rb +23 -0
  52. data/test/dummy/config/boot.rb +5 -0
  53. data/test/dummy/config/database.yml +25 -0
  54. data/test/dummy/config/environment.rb +5 -0
  55. data/test/dummy/config/environments/development.rb +29 -0
  56. data/test/dummy/config/environments/production.rb +80 -0
  57. data/test/dummy/config/environments/test.rb +36 -0
  58. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  59. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  60. data/test/dummy/config/initializers/inflections.rb +16 -0
  61. data/test/dummy/config/initializers/mime_types.rb +5 -0
  62. data/test/dummy/config/initializers/secret_token.rb +12 -0
  63. data/test/dummy/config/initializers/seo_initializer.rb +8 -0
  64. data/test/dummy/config/initializers/session_store.rb +3 -0
  65. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  66. data/test/dummy/config/locales/en.yml +23 -0
  67. data/test/dummy/config/routes.rb +4 -0
  68. data/test/dummy/config.ru +4 -0
  69. data/test/dummy/db/development.sqlite3 +0 -0
  70. data/test/dummy/db/schema.rb +33 -0
  71. data/test/dummy/log/development.log +7489 -0
  72. data/test/dummy/public/404.html +58 -0
  73. data/test/dummy/public/422.html +58 -0
  74. data/test/dummy/public/500.html +57 -0
  75. data/test/dummy/public/favicon.ico +0 -0
  76. data/test/fixtures/seo/seo_page_defaults.yml +11 -0
  77. data/test/fixtures/seo/seo_pages.yml +13 -0
  78. data/test/helpers/seo/seo_page_defaults_helper_test.rb +6 -0
  79. data/test/helpers/seo/seo_pages_helper_test.rb +6 -0
  80. data/test/integration/navigation_test.rb +10 -0
  81. data/test/models/seo/seo_page_default_test.rb +9 -0
  82. data/test/models/seo/seo_page_test.rb +9 -0
  83. data/test/seo_test.rb +7 -0
  84. data/test/test_helper.rb +15 -0
  85. metadata +190 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: a69208a7dd53f9523fe0954a2960d338c87568ee
4
+ data.tar.gz: eca6b0508866f42f2f34acff3689a3b355008019
5
+ SHA512:
6
+ metadata.gz: d5bbc930d734c37c5d743d59e3bc8eb5efea56fc5250e9186e132c9f3610b92a7a87efcefd8d6b10e650e9f7e0f57db2e80f5306ddfddb02f80850ca79af5e17
7
+ data.tar.gz: 8cd8459cc0f07fbadd370a57a7fe2fd5d3dd099f2ee16c884a3fe4ab40e1924c2084a2f09fc6ed7ab8744a24af9bc002d9a1be79762ed6638fd1e0dbeed1e275
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright 2013 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/README.rdoc ADDED
@@ -0,0 +1,34 @@
1
+ = Seo
2
+
3
+ ## Introduction
4
+
5
+ ### Installation
6
+
7
+ Update your Gemfile
8
+
9
+ ```ruby
10
+ gem 'seo'
11
+ ```
12
+ run bundle install
13
+
14
+ After installation
15
+
16
+ ```ruby
17
+ rake seo:install:migration
18
+ ```
19
+
20
+ You will need to provide a before_action require_admin in an initializer
21
+ create a file seo_initializer.rb in initializer directory
22
+
23
+ ```ruby
24
+ module Seo
25
+ class ApplicationController < ActionController::Base
26
+
27
+ def require_admin
28
+ redirect_to(root_path) unless current_user.admin?
29
+ end
30
+
31
+ end
32
+ end
33
+ ```
34
+
data/Rakefile ADDED
@@ -0,0 +1,34 @@
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 = 'Seo'
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("../test/dummy/Rakefile", __FILE__)
18
+ load 'rails/tasks/engine.rake'
19
+
20
+
21
+
22
+ Bundler::GemHelper.install_tasks
23
+
24
+ require 'rake/testtask'
25
+
26
+ Rake::TestTask.new(:test) do |t|
27
+ t.libs << 'lib'
28
+ t.libs << 'test'
29
+ t.pattern = 'test/**/*_test.rb'
30
+ t.verbose = false
31
+ end
32
+
33
+
34
+ task default: :test
@@ -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,2 @@
1
+ // Place all the behaviors and hooks related to the matching controller here.
2
+ // All this logic will automatically be available in application.js.
@@ -0,0 +1,2 @@
1
+ // Place all the behaviors and hooks related to the matching controller here.
2
+ // All this logic will automatically be available in application.js.
@@ -0,0 +1,56 @@
1
+ body { background-color: #fff; color: #333; }
2
+
3
+ body, p, ol, ul, td {
4
+ font-family: verdana, arial, helvetica, sans-serif;
5
+ font-size: 13px;
6
+ line-height: 18px;
7
+ }
8
+
9
+ pre {
10
+ background-color: #eee;
11
+ padding: 10px;
12
+ font-size: 11px;
13
+ }
14
+
15
+ a { color: #000; }
16
+ a:visited { color: #666; }
17
+ a:hover { color: #fff; background-color:#000; }
18
+
19
+ div.field, div.actions {
20
+ margin-bottom: 10px;
21
+ }
22
+
23
+ #notice {
24
+ color: green;
25
+ }
26
+
27
+ .field_with_errors {
28
+ padding: 2px;
29
+ background-color: red;
30
+ display: table;
31
+ }
32
+
33
+ #error_explanation {
34
+ width: 450px;
35
+ border: 2px solid red;
36
+ padding: 7px;
37
+ padding-bottom: 0;
38
+ margin-bottom: 20px;
39
+ background-color: #f0f0f0;
40
+ }
41
+
42
+ #error_explanation h2 {
43
+ text-align: left;
44
+ font-weight: bold;
45
+ padding: 5px 5px 5px 15px;
46
+ font-size: 12px;
47
+ margin: -7px;
48
+ margin-bottom: 0px;
49
+ background-color: #c00;
50
+ color: #fff;
51
+ }
52
+
53
+ #error_explanation ul li {
54
+ font-size: 12px;
55
+ list-style: square;
56
+ }
@@ -0,0 +1,24 @@
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 top of the
9
+ * compiled file, but it's generally better to create a new file per style scope.
10
+ *
11
+ *= require_self
12
+ *= require_tree .
13
+ */
14
+
15
+ .seo-table{
16
+ width: 100%;
17
+ }
18
+ .seo-table tr{
19
+ text-align: center;
20
+ }
21
+
22
+ .seo-info {
23
+ color: green;
24
+ }
@@ -0,0 +1,4 @@
1
+ /*
2
+ Place all the styles related to the matching controller here.
3
+ They will automatically be included in application.css.
4
+ */
@@ -0,0 +1,4 @@
1
+ /*
2
+ Place all the styles related to the matching controller here.
3
+ They will automatically be included in application.css.
4
+ */
@@ -0,0 +1,6 @@
1
+ module Seo
2
+ class ApplicationController < ActionController::Base
3
+ before_action :require_seo_admin
4
+
5
+ end
6
+ end
@@ -0,0 +1,62 @@
1
+ require_dependency "seo/application_controller"
2
+
3
+ module Seo
4
+ class SeoPageDefaultsController < ApplicationController
5
+ before_action :set_seo_page_default, only: [:show, :edit, :update, :destroy]
6
+
7
+ # GET /seo_page_defaults
8
+ def index
9
+ @seo_page_defaults = SeoPageDefault.all
10
+ end
11
+
12
+ # GET /seo_page_defaults/1
13
+ def show
14
+ end
15
+
16
+ # GET /seo_page_defaults/new
17
+ # def new
18
+ # @seo_page_default = SeoPageDefault.new
19
+ # end
20
+
21
+ # GET /seo_page_defaults/1/edit
22
+ def edit
23
+ end
24
+
25
+ # POST /seo_page_defaults
26
+ # def create
27
+ # @seo_page_default = SeoPageDefault.new(seo_page_default_params)
28
+
29
+ # if @seo_page_default.save
30
+ # redirect_to @seo_page_default, notice: 'Seo page default was successfully created.'
31
+ # else
32
+ # render action: 'new'
33
+ # end
34
+ # end
35
+
36
+ # PATCH/PUT /seo_page_defaults/1
37
+ def update
38
+ if @seo_page_default.update(seo_page_default_params)
39
+ redirect_to @seo_page_default, notice: 'Seo page default was successfully updated.'
40
+ else
41
+ render action: 'edit'
42
+ end
43
+ end
44
+
45
+ # DELETE /seo_page_defaults/1
46
+ # def destroy
47
+ # @seo_page_default.destroy
48
+ # redirect_to seo_page_defaults_url, notice: 'Seo page default was successfully destroyed.'
49
+ # end
50
+
51
+ private
52
+ # Use callbacks to share common setup or constraints between actions.
53
+ def set_seo_page_default
54
+ @seo_page_default = SeoPageDefault.first #find(params[:id])
55
+ end
56
+
57
+ # Only allow a trusted parameter "white list" through.
58
+ def seo_page_default_params
59
+ params.require(:seo_page_default).permit(:page_title, :meta_keywords, :meta_description)
60
+ end
61
+ end
62
+ end
@@ -0,0 +1,64 @@
1
+ require_dependency "seo/application_controller"
2
+
3
+ module Seo
4
+ class SeoPagesController < ApplicationController
5
+ before_action :set_seo_page, only: [:show, :edit, :update, :destroy]
6
+
7
+ # GET /seo_pages
8
+ def index
9
+ # Display defaults in the index page if needed.
10
+ @seo_defaults = SeoPageDefault.first
11
+ @seo_pages = SeoPage.all
12
+ end
13
+
14
+ # GET /seo_pages/1
15
+ def show
16
+ end
17
+
18
+ # GET /seo_pages/new
19
+ def new
20
+ @seo_page = SeoPage.new
21
+ end
22
+
23
+ # GET /seo_pages/1/edit
24
+ def edit
25
+ end
26
+
27
+ # POST /seo_pages
28
+ def create
29
+ @seo_page = SeoPage.new(seo_page_params)
30
+
31
+ if @seo_page.save
32
+ redirect_to @seo_page, notice: 'Seo page was successfully created.'
33
+ else
34
+ render action: 'new'
35
+ end
36
+ end
37
+
38
+ # PATCH/PUT /seo_pages/1
39
+ def update
40
+ if @seo_page.update(seo_page_params)
41
+ redirect_to @seo_page, notice: 'Seo page was successfully updated.'
42
+ else
43
+ render action: 'edit'
44
+ end
45
+ end
46
+
47
+ # DELETE /seo_pages/1
48
+ def destroy
49
+ @seo_page.destroy
50
+ redirect_to seo_pages_url, notice: 'Seo page was successfully destroyed.'
51
+ end
52
+
53
+ private
54
+ # Use callbacks to share common setup or constraints between actions.
55
+ def set_seo_page
56
+ @seo_page = SeoPage.find(params[:id])
57
+ end
58
+
59
+ # Only allow a trusted parameter "white list" through.
60
+ def seo_page_params
61
+ params.require(:seo_page).permit(:page_title, :meta_keywords, :meta_description, :url_identifier)
62
+ end
63
+ end
64
+ end
@@ -0,0 +1,16 @@
1
+ module Seo
2
+ module ApplicationHelper
3
+
4
+ def seo_data
5
+ @seo_default ||= Seo::SeoPageDefault.first
6
+ @seo = Seo::SeoPage.where(url_identifier: request.fullpath).first || Seo::SeoPage.new
7
+
8
+ @seo.page_title ||= @seo_default.page_title
9
+ @seo.meta_keywords ||= @seo_default.meta_keywords
10
+ @seo.meta_description ||= @seo_default.meta_description
11
+
12
+ @seo
13
+ end
14
+
15
+ end
16
+ end
@@ -0,0 +1,4 @@
1
+ module Seo
2
+ module SeoPageDefaultsHelper
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module Seo
2
+ module SeoPagesHelper
3
+ end
4
+ end
@@ -0,0 +1,5 @@
1
+ module Seo
2
+ class SeoPage < ActiveRecord::Base
3
+ validates :url_identifier, uniqueness: true
4
+ end
5
+ end
@@ -0,0 +1,10 @@
1
+ module Seo
2
+ class SeoPageDefault < ActiveRecord::Base
3
+ validate :page_title, :meta_keywords, :meta_description, presence: true
4
+
5
+ PAGE_TITLE_DEFAULT = 'Edit Page Title Default'
6
+ PAGE_META_KEYWORDS_DEFAULT = 'Edit Page Meta Keywords Default'
7
+ PAGE_META_DESCRIPTION_DEFAULT = 'Edit Page Meta Description Default'
8
+
9
+ end
10
+ end
@@ -0,0 +1,18 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+
5
+ <title><%= seo_data.page_title %></title>
6
+ <meta name="description" content="<%= seo_data.meta_description %>" />
7
+ <meta name="keywords" content="<%= seo_data.meta_keywords %>" />
8
+
9
+ <%= stylesheet_link_tag "seo/application", media: "all" %>
10
+ <%= javascript_include_tag "seo/application" %>
11
+ <%= csrf_meta_tags %>
12
+ </head>
13
+ <body>
14
+
15
+ <%= yield %>
16
+
17
+ </body>
18
+ </html>
@@ -0,0 +1,33 @@
1
+ <%= form_for(@seo_page_default) do |f| %>
2
+ <% if @seo_page_default.errors.any? %>
3
+ <div id="error_explanation">
4
+ <h2><%= pluralize(@seo_page_default.errors.count, "error") %> prohibited this seo_page_default from being saved:</h2>
5
+
6
+ <ul>
7
+ <% @seo_page_default.errors.full_messages.each do |msg| %>
8
+ <li><%= msg %></li>
9
+ <% end %>
10
+ </ul>
11
+ </div>
12
+ <% end %>
13
+
14
+ <p class="seo-info">
15
+ Fields max length is 255 character.
16
+ </p>
17
+
18
+ <div class="field">
19
+ <%= f.label :page_title %><br>
20
+ <%= f.text_area :page_title %>
21
+ </div>
22
+ <div class="field">
23
+ <%= f.label :meta_keywords %><br>
24
+ <%= f.text_area :meta_keywords %>
25
+ </div>
26
+ <div class="field">
27
+ <%= f.label :meta_description %><br>
28
+ <%= f.text_area :meta_description %>
29
+ </div>
30
+ <div class="actions">
31
+ <%= f.submit %>
32
+ </div>
33
+ <% end %>
@@ -0,0 +1,6 @@
1
+ <h1>Editing Seo Page Default</h1>
2
+
3
+ <%= render 'form' %>
4
+
5
+ <%= link_to 'Show', @seo_page_default %> |
6
+ <%= link_to 'Back', seo_page_defaults_path %>
@@ -0,0 +1,27 @@
1
+ <h1>Listing Seo Page Defaults</h1>
2
+
3
+ <table>
4
+ <thead>
5
+ <tr>
6
+ <th>Page title</th>
7
+ <th>Meta keywrods</th>
8
+ <th>Meta description</th>
9
+ <th></th>
10
+ <th></th>
11
+ <th></th>
12
+ </tr>
13
+ </thead>
14
+
15
+ <tbody>
16
+ <% @seo_page_defaults.each do |seo_page_default| %>
17
+ <tr>
18
+ <td><%= seo_page_default.page_title %></td>
19
+ <td><%= seo_page_default.meta_keywords %></td>
20
+ <td><%= seo_page_default.meta_description %></td>
21
+ <td><%= link_to 'Show', seo_page_default %></td>
22
+ <td><%= link_to 'Edit', edit_seo_page_default_path(seo_page_default) %></td>
23
+ <td></td>
24
+ </tr>
25
+ <% end %>
26
+ </tbody>
27
+ </table>
@@ -0,0 +1,5 @@
1
+ <h1>New Seo Page Default</h1>
2
+
3
+ <%= render 'form' %>
4
+
5
+ <%= link_to 'Back', seo_page_defaults_path %>
@@ -0,0 +1,19 @@
1
+ <p id="notice"><%= notice %></p>
2
+
3
+ <p>
4
+ <strong>Page title:</strong>
5
+ <%= @seo_page_default.page_title %>
6
+ </p>
7
+
8
+ <p>
9
+ <strong>Meta keywrods:</strong>
10
+ <%= @seo_page_default.meta_keywords %>
11
+ </p>
12
+
13
+ <p>
14
+ <strong>Meta description:</strong>
15
+ <%= @seo_page_default.meta_description %>
16
+ </p>
17
+
18
+ <%= link_to 'Edit', edit_seo_page_default_path(@seo_page_default) %> |
19
+ <%= link_to 'Back', seo_page_defaults_path %>
@@ -0,0 +1,38 @@
1
+ <%= form_for(@seo_page) do |f| %>
2
+ <% if @seo_page.errors.any? %>
3
+ <div id="error_explanation">
4
+ <h2><%= pluralize(@seo_page.errors.count, "error") %> prohibited this Seo Page from being saved:</h2>
5
+
6
+ <ul>
7
+ <% @seo_page.errors.full_messages.each do |msg| %>
8
+ <li><%= msg %></li>
9
+ <% end %>
10
+ </ul>
11
+ </div>
12
+ <% end %>
13
+ <p class="seo-info">
14
+ Fields max length is 255 character.
15
+ </p>
16
+
17
+ <div class="field">
18
+ <%= f.label :url_identifier %><br>
19
+ <%= f.text_field :url_identifier %>
20
+ </div>
21
+
22
+ <div class="field">
23
+ <%= f.label :page_title %><br>
24
+ <%= f.text_area :page_title %>
25
+ </div>
26
+ <div class="field">
27
+ <%= f.label :meta_keywords %><br>
28
+ <%= f.text_area :meta_keywords %>
29
+ </div>
30
+ <div class="field">
31
+ <%= f.label :meta_description %><br>
32
+ <%= f.text_area :meta_description %>
33
+ </div>
34
+
35
+ <div class="actions">
36
+ <%= f.submit %>
37
+ </div>
38
+ <% end %>
@@ -0,0 +1,6 @@
1
+ <h1>Editing seo_page</h1>
2
+
3
+ <%= render 'form' %>
4
+
5
+ <%= link_to 'Show', @seo_page %> |
6
+ <%= link_to 'Back', seo_pages_path %>
@@ -0,0 +1,44 @@
1
+ <h1>Listing Seo Pges</h1>
2
+
3
+ <table class="seo-table">
4
+ <thead>
5
+ <tr>
6
+ <th>Url identifier</th>
7
+ <th>Page title</th>
8
+ <th>Meta keywrods</th>
9
+ <th>Meta description</th>
10
+
11
+ <th></th>
12
+ <th></th>
13
+ <th></th>
14
+ </tr>
15
+ </thead>
16
+
17
+ <tbody>
18
+ <tr>
19
+ <td> Default </td>
20
+ <td><%= @seo_defaults.page_title %></td>
21
+ <td><%= @seo_defaults.meta_keywords %></td>
22
+ <td><%= @seo_defaults.meta_description %></td>
23
+ <td></td>
24
+ <td><%= link_to 'Edit', edit_seo_page_default_path(@seo_defaults) %></td>
25
+ <d></td>
26
+ </tr>
27
+ <% @seo_pages.each do |seo_page| %>
28
+ <tr>
29
+ <td><%= seo_page.url_identifier %></td>
30
+ <td><%= seo_page.page_title %></td>
31
+ <td><%= seo_page.meta_keywords %></td>
32
+ <td><%= seo_page.meta_description %></td>
33
+
34
+ <td><%= link_to 'Show', seo_page %></td>
35
+ <td><%= link_to 'Edit', edit_seo_page_path(seo_page) %></td>
36
+ <td><%= link_to 'Destroy', seo_page, method: :delete, data: { confirm: 'Are you sure?' } %></td>
37
+ </tr>
38
+ <% end %>
39
+ </tbody>
40
+ </table>
41
+
42
+ <br>
43
+
44
+ <%= link_to 'New Seo page', new_seo_page_path %>
@@ -0,0 +1,5 @@
1
+ <h1>New seo_page</h1>
2
+
3
+ <%= render 'form' %>
4
+
5
+ <%= link_to 'Back', seo_pages_path %>
@@ -0,0 +1,24 @@
1
+ <p id="notice"><%= notice %></p>
2
+
3
+ <p>
4
+ <strong>Page title:</strong>
5
+ <%= @seo_page.page_title %>
6
+ </p>
7
+
8
+ <p>
9
+ <strong>Meta keywrods:</strong>
10
+ <%= @seo_page.meta_keywords %>
11
+ </p>
12
+
13
+ <p>
14
+ <strong>Meta description:</strong>
15
+ <%= @seo_page.meta_description %>
16
+ </p>
17
+
18
+ <p>
19
+ <strong>Url identifier:</strong>
20
+ <%= @seo_page.url_identifier %>
21
+ </p>
22
+
23
+ <%= link_to 'Edit', edit_seo_page_path(@seo_page) %> |
24
+ <%= link_to 'Back', seo_pages_path %>
data/config/routes.rb ADDED
@@ -0,0 +1,7 @@
1
+ Seo::Engine.routes.draw do
2
+ root to: "seo_pages#index"
3
+ resources :seo_page_defaults
4
+
5
+ resources :seo_pages
6
+
7
+ end
@@ -0,0 +1,12 @@
1
+ class CreateSeoSeoPages < ActiveRecord::Migration
2
+ def change
3
+ create_table :seo_seo_pages do |t|
4
+ t.string :page_title
5
+ t.string :meta_keywords
6
+ t.string :meta_description
7
+ t.string :url_identifier
8
+
9
+ t.timestamps
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,11 @@
1
+ class CreateSeoSeoPageDefaults < ActiveRecord::Migration
2
+ def change
3
+ create_table :seo_seo_page_defaults do |t|
4
+ t.string :page_title
5
+ t.string :meta_keywords
6
+ t.string :meta_description
7
+
8
+ t.timestamps
9
+ end
10
+ end
11
+ end