seiten 0.0.8 → 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 (104) hide show
  1. checksums.yaml +5 -5
  2. data/Rakefile +1 -0
  3. data/app/controllers/seiten/pages_controller.rb +2 -18
  4. data/config/initializers/seiten.rb +1 -1
  5. data/lib/seiten/errors/base_error.rb +4 -0
  6. data/lib/seiten/errors/page_error.rb +4 -0
  7. data/lib/seiten/errors/routing_error.rb +4 -0
  8. data/lib/seiten/helpers/backend.rb +23 -0
  9. data/lib/seiten/helpers/current.rb +33 -0
  10. data/lib/seiten/helpers/frontend.rb +19 -0
  11. data/lib/seiten/html/breadcrumb.rb +41 -0
  12. data/lib/seiten/html/helpers.rb +32 -0
  13. data/lib/seiten/html/navigation.rb +39 -0
  14. data/lib/seiten/navigation.rb +43 -0
  15. data/lib/seiten/page.rb +71 -50
  16. data/lib/seiten/page_collection.rb +54 -0
  17. data/lib/seiten/page_collection_builder.rb +63 -0
  18. data/lib/seiten/railtie.rb +7 -0
  19. data/lib/seiten/routes_helper.rb +16 -11
  20. data/lib/seiten/slug_builder.rb +32 -0
  21. data/lib/seiten/version.rb +1 -1
  22. data/lib/seiten.rb +63 -12
  23. data/test/controllers/helper_methods_test.rb +25 -0
  24. data/test/controllers/pages_controller_test.rb +9 -0
  25. data/test/controllers/posts_controller_test.rb +12 -0
  26. data/test/controllers/seiten/pages_controller_test.rb +39 -0
  27. data/test/dummy/app/controllers/application_controller.rb +10 -0
  28. data/test/dummy/app/controllers/pages_controller.rb +1 -1
  29. data/test/dummy/app/controllers/posts_controller.rb +10 -0
  30. data/test/dummy/app/helpers/application_helper.rb +1 -0
  31. data/test/dummy/app/pages/{de → application/de}/produkte.html.erb +0 -0
  32. data/test/dummy/app/pages/{en/about/our-team/switzerland.html.erb → application/en/about/our-team/italy.html.erb} +0 -0
  33. data/test/dummy/app/pages/{en/about/works.html.erb → application/en/about/our-team/switzerland.html.erb} +0 -0
  34. data/test/dummy/app/pages/application/en/about/our-team.html.erb +2 -0
  35. data/test/dummy/app/pages/application/en/about/partners.html.erb +1 -0
  36. data/test/dummy/app/pages/{en/contact.html.erb → application/en/about/works.html.erb} +0 -0
  37. data/test/dummy/app/pages/{en/about/our-team/italy.html.erb → application/en/about.html.erb} +0 -0
  38. data/test/dummy/app/pages/{en/products/logo-design.html.erb → application/en/contact.html.erb} +0 -0
  39. data/test/dummy/app/pages/{en → application/en}/home.html.erb +0 -0
  40. data/test/dummy/app/pages/{en/products/web-development.html.erb → application/en/products/hire-us.html.erb} +0 -0
  41. data/test/dummy/{db/test.sqlite3 → app/pages/application/en/products/logo-design.html.erb} +0 -0
  42. data/test/dummy/app/pages/application/en/products/web-development.html.erb +0 -0
  43. data/test/dummy/app/pages/{en → application/en}/products.html.erb +0 -0
  44. data/test/dummy/app/pages/{localization.html.erb → application/localization.html.erb} +0 -0
  45. data/test/dummy/app/pages/help/en/home.html.erb +0 -0
  46. data/test/dummy/app/pages/help/en/logging-in.html.erb +0 -0
  47. data/test/dummy/app/views/layouts/application.html.erb +1 -1
  48. data/test/dummy/app/views/layouts/home.html.erb +1 -1
  49. data/test/dummy/app/views/pages/secret.html.erb +1 -1
  50. data/test/dummy/app/views/posts/index.html.erb +1 -0
  51. data/test/dummy/config/application.rb +4 -41
  52. data/test/dummy/config/boot.rb +2 -9
  53. data/test/dummy/config/cable.yml +9 -0
  54. data/test/dummy/config/environments/development.rb +26 -21
  55. data/test/dummy/config/environments/production.rb +3 -0
  56. data/test/dummy/config/environments/test.rb +15 -19
  57. data/test/dummy/config/initializers/application_controller_renderer.rb +6 -0
  58. data/test/dummy/config/initializers/cookies_serializer.rb +5 -0
  59. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  60. data/test/dummy/config/initializers/inflections.rb +6 -5
  61. data/test/dummy/config/initializers/mime_types.rb +0 -1
  62. data/test/dummy/config/initializers/new_framework_defaults.rb +20 -0
  63. data/test/dummy/config/initializers/session_store.rb +1 -6
  64. data/test/dummy/config/initializers/wrap_parameters.rb +5 -5
  65. data/test/dummy/config/{navigation/de.yml → navigations/application.de.yml} +5 -5
  66. data/test/dummy/config/{navigation/en.yml → navigations/application.en.yml} +15 -7
  67. data/test/dummy/config/navigations/help.en.yml +17 -0
  68. data/test/dummy/config/routes.rb +6 -3
  69. data/test/dummy/config/secrets.yml +22 -0
  70. data/test/dummy/log/development.log +1716 -4559
  71. data/test/dummy/log/test.log +43833 -16254
  72. data/test/fixtures/breadcrumb.html +1 -0
  73. data/test/fixtures/navigation.html +1 -0
  74. data/test/integration/layout_test.rb +10 -11
  75. data/test/integration/navigation_test.rb +50 -50
  76. data/test/lib/seiten/helpers/frontend_test.rb +37 -0
  77. data/test/lib/seiten/html/breadcrumb_test.rb +29 -0
  78. data/test/lib/seiten/html/helpers_test.rb +55 -0
  79. data/test/lib/seiten/html/navigation_test.rb +29 -0
  80. data/test/lib/seiten/navigation_test.rb +45 -0
  81. data/test/lib/seiten/page_collection_builder_test.rb +141 -0
  82. data/test/lib/seiten/page_collection_test.rb +59 -0
  83. data/test/lib/seiten/page_test.rb +188 -0
  84. data/test/lib/seiten/slug_builder_test.rb +47 -0
  85. data/test/lib/seiten_test.rb +16 -0
  86. data/test/test_helper.rb +2 -8
  87. metadata +134 -78
  88. data/app/helpers/seiten_helper.rb +0 -46
  89. data/lib/seiten/controllers/helpers.rb +0 -16
  90. data/lib/seiten/page_store.rb +0 -165
  91. data/test/dummy/app/assets/javascripts/application.js +0 -15
  92. data/test/dummy/app/assets/stylesheets/application.css +0 -13
  93. data/test/dummy/app/pages/en/about/our-team.html.erb +0 -2
  94. data/test/dummy/app/pages/en/about/partners.html.erb +0 -1
  95. data/test/dummy/config/navigation.yml +0 -37
  96. data/test/dummy/db/development.sqlite3 +0 -0
  97. data/test/dummy/tmp/cache/assets/CD8/370/sprockets%2F357970feca3ac29060c1e3861e2c0953 +0 -0
  98. data/test/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705 +0 -0
  99. data/test/dummy/tmp/cache/assets/D5A/EA0/sprockets%2Fd771ace226fc8215a3572e0aa35bb0d6 +0 -0
  100. data/test/integration/i18n_test.rb +0 -31
  101. data/test/integration/redirect_test.rb +0 -15
  102. data/test/page_store_test.rb +0 -28
  103. data/test/page_test.rb +0 -104
  104. data/test/seiten_test.rb +0 -11
data/lib/seiten.rb CHANGED
@@ -1,26 +1,77 @@
1
1
  require 'seiten/engine'
2
- require 'seiten/page_store'
2
+ require 'seiten/railtie'
3
+ require 'seiten/navigation'
3
4
  require 'seiten/page'
5
+ require 'seiten/page_collection'
6
+ require 'seiten/page_collection_builder'
7
+ require 'seiten/slug_builder'
4
8
  require 'seiten/routes_helper'
9
+ require 'seiten/helpers/current'
10
+ require 'seiten/helpers/backend'
11
+ require 'seiten/helpers/frontend'
12
+ require 'seiten/html/helpers'
13
+ require 'seiten/html/navigation'
14
+ require 'seiten/html/breadcrumb'
15
+ require 'seiten/errors/base_error'
16
+ require 'seiten/errors/page_error'
17
+ require 'seiten/errors/routing_error'
5
18
 
6
19
  module Seiten
7
-
8
20
  @config = {
9
- default_storage_type: :yaml,
10
- default_storage_file: File.join('config', 'navigation'),
11
- default_storage_directory: File.join('app', 'pages'),
12
- root_page_filename: "home"
21
+ config_dir: File.join('config', 'navigations'),
22
+ pages_dir: File.join('app', 'pages'),
23
+ root_page: 'home',
24
+ default_layout: 'application',
25
+ html: {
26
+ navigation: {
27
+ base: 'navigation',
28
+ item: 'navigation__item',
29
+ nodes: 'navigation__nodes',
30
+ },
31
+ breadcrumb: {
32
+ base: 'breadcrumb',
33
+ item: 'breadcrumb__item',
34
+ separator: 'breadcrumb__separator',
35
+ },
36
+ modifier: {
37
+ base: nil, # if nil we use the main class combined with the element class
38
+ separator: '--', # modifier separator
39
+ parent: 'parent',
40
+ active: 'active',
41
+ current: 'current',
42
+ expanded: 'expanded'
43
+ }
44
+ }
13
45
  }
14
46
 
15
- def self.config
16
- @config
17
- end
47
+ @navigations = []
48
+
49
+ class << self
50
+ def config
51
+ @config
52
+ end
53
+
54
+ def navigations
55
+ @navigations
56
+ end
57
+
58
+ def navigations=(navigations)
59
+ @navigations = navigations
60
+ end
18
61
 
19
- module Controllers
20
- autoload :Helpers, 'seiten/controllers/helpers'
62
+ def initialize_navigations
63
+ Dir[File.join(Rails.root, Seiten.config[:config_dir], "*.yml")].each do |file|
64
+ id = File.basename(file, '.yml')
65
+ name = id.gsub(/\..*/, '')
66
+ locale = id.gsub(/.*\./, '')
67
+ navigation = Seiten::Navigation.new(name: name, locale: locale, dir: File.join(Rails.root, Seiten.config[:pages_dir], name, locale))
68
+ navigation.page_collection.build(pages: YAML.load_file(navigation.config))
69
+ Seiten.navigations << navigation
70
+ end
71
+ end
21
72
  end
22
73
 
23
74
  ActiveSupport.on_load(:action_controller) do
24
- include Controllers::Helpers
75
+ include Helpers::Current
25
76
  end
26
77
  end
@@ -0,0 +1,25 @@
1
+ require 'test_helper'
2
+
3
+ class CustomPagesController < ActionController::Base
4
+ include Seiten::Helpers::Backend
5
+ end
6
+
7
+ class CurrentHelperMethodsTest < ActionController::TestCase
8
+ tests CustomPagesController
9
+
10
+ test 'includes Seiten::ControllerHelpers::Current' do
11
+ assert_includes @controller.class.ancestors, Seiten::Helpers::Current
12
+ end
13
+
14
+ test 'includes Seiten::ControllerHelpers::Backend' do
15
+ assert_includes @controller.class.ancestors, Seiten::Helpers::Backend
16
+ end
17
+
18
+ test 'defines methods like current_navigation' do
19
+ assert_respond_to @controller, :current_navigation
20
+ end
21
+
22
+ test 'defines methods like current_page' do
23
+ assert_respond_to @controller, :current_page
24
+ end
25
+ end
@@ -0,0 +1,9 @@
1
+ require 'test_helper'
2
+
3
+ class PagesControllerTest < ActionController::TestCase
4
+ test "should not set current page on pages controller" do
5
+ get :secret
6
+ assert Seiten::Navigation.find_by(name: 'application'), @controller.instance_eval { @current_navigation }
7
+ assert_nil @controller.instance_eval { @current_page }
8
+ end
9
+ end
@@ -0,0 +1,12 @@
1
+ require 'test_helper'
2
+
3
+ class PostsControllerTest < ActionController::TestCase
4
+ def navigation
5
+ @navigation ||= Seiten::Navigation.find_by(name: 'application', locale: 'en')
6
+ end
7
+
8
+ test "should set current page on posts controller" do
9
+ get :index
10
+ assert_equal navigation.pages.find_by(slug: "blog"), @controller.instance_eval { @current_page }
11
+ end
12
+ end
@@ -0,0 +1,39 @@
1
+ require 'test_helper'
2
+
3
+ class Seiten::ApplicationPagesControllerTest < ActionController::TestCase
4
+ setup do
5
+ @controller = Seiten::PagesController.new
6
+ end
7
+
8
+ def navigation
9
+ @navigation ||= Seiten::Navigation.find_by(name: 'application', locale: 'en')
10
+ end
11
+
12
+ test 'should set current page when params[:slug] is empty' do
13
+ get :show, params: { slug: '' }
14
+ assert_equal(navigation, @controller.instance_eval { @current_navigation })
15
+ assert_equal(navigation.pages.find_by(slug: ''), @controller.instance_eval { @current_page })
16
+ end
17
+
18
+ test 'should set products page as current page' do
19
+ get :show, params: { slug: 'products' }
20
+ assert_equal(navigation, @controller.instance_eval { @current_navigation })
21
+ assert_equal(navigation.pages.find_by(slug: 'products'), @controller.instance_eval { @current_page })
22
+ end
23
+ end
24
+
25
+ class Seiten::HelpPagesControllerTest < ActionController::TestCase
26
+ setup do
27
+ @controller = Seiten::PagesController.new
28
+ end
29
+
30
+ def navigation
31
+ @navigation ||= Seiten::Navigation.find_by(name: 'help', locale: 'en')
32
+ end
33
+
34
+ test 'should set products page as current page' do
35
+ get :show, params: { slug: 'logging-in', navigation_id: 'help' }
36
+ assert_equal(navigation, @controller.instance_eval { @current_navigation })
37
+ assert_equal(navigation.pages.find_by(slug: 'logging-in'), @controller.instance_eval { @current_page })
38
+ end
39
+ end
@@ -1,3 +1,13 @@
1
1
  class ApplicationController < ActionController::Base
2
2
  protect_from_forgery
3
+
4
+ before_action :set_seo_values
5
+
6
+ private
7
+
8
+ def set_seo_values
9
+ if current_page
10
+ @title = current_page.data[:title] || current_page.title
11
+ end
12
+ end
3
13
  end
@@ -1,5 +1,5 @@
1
1
  class PagesController < ApplicationController
2
-
3
2
  def secret
3
+ @title = current_page
4
4
  end
5
5
  end
@@ -0,0 +1,10 @@
1
+ class PostsController < ApplicationController
2
+ def index
3
+ end
4
+
5
+ private
6
+
7
+ def set_current_page
8
+ current_navigation.pages.find_by(slug: 'blog')
9
+ end
10
+ end
@@ -1,2 +1,3 @@
1
1
  module ApplicationHelper
2
+ include Seiten::Helpers::Frontend
2
3
  end
@@ -0,0 +1,2 @@
1
+ <h1>Subnavigation</h1>
2
+ <%= seiten_navigation(parent_id: current_page.id) %>
@@ -0,0 +1 @@
1
+ <%= seiten_navigation(parent_id: current_page.id) %>
File without changes
File without changes
@@ -1,7 +1,7 @@
1
1
  <!DOCTYPE html>
2
2
  <html>
3
3
  <head>
4
- <title>Dummy</title>
4
+ <title><%= @title %></title>
5
5
  <%= stylesheet_link_tag "application", :media => "all" %>
6
6
  <%# <%= javascript_include_tag "application" %1> %>
7
7
  <%= csrf_meta_tags %>
@@ -1,7 +1,7 @@
1
1
  <!DOCTYPE html>
2
2
  <html>
3
3
  <head>
4
- <title>Dummy</title>
4
+ <title><%= @title %></title>
5
5
  <%= stylesheet_link_tag "application", :media => "all" %>
6
6
  <%# <%= javascript_include_tag "application" %1> %>
7
7
  <%= csrf_meta_tags %>
@@ -1 +1 @@
1
- This is a secret page
1
+ <p>pages#secret</p>
@@ -0,0 +1 @@
1
+ <p>posts#index</p>
@@ -1,6 +1,7 @@
1
1
  require File.expand_path('../boot', __FILE__)
2
2
 
3
- require 'rails/all'
3
+ require "action_controller/railtie"
4
+ require "action_view/railtie"
4
5
 
5
6
  Bundler.require(*Rails.groups)
6
7
  require "seiten"
@@ -14,46 +15,8 @@ module Dummy
14
15
  # Custom directories with classes and modules you want to be autoloadable.
15
16
  # config.autoload_paths += %W(#{config.root}/extras)
16
17
 
17
- # Only load the plugins named here, in the order given (default is alphabetical).
18
- # :all can be used as a placeholder for all plugins not explicitly named.
19
- # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
20
-
21
- # Activate observers that should always be running.
22
- # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
23
-
24
- # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
25
- # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
26
- # config.time_zone = 'Central Time (US & Canada)'
27
-
28
- # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
29
- # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
30
- # config.i18n.default_locale = :de
31
-
32
- # Configure the default encoding used in templates for Ruby 1.9.
33
- config.encoding = "utf-8"
34
-
35
- # Configure sensitive parameters which will be filtered from the log file.
36
- config.filter_parameters += [:password]
37
-
38
- # Enable escaping HTML in JSON.
39
- config.active_support.escape_html_entities_in_json = true
40
-
41
- # Use SQL instead of Active Record's schema dumper when creating the database.
42
- # This is necessary if your schema can't be completely dumped by the schema dumper,
43
- # like if you have constraints or database-specific column types
44
- # config.active_record.schema_format = :sql
45
-
46
- # Enforce whitelist mode for mass assignment.
47
- # This will create an empty whitelist of attributes available for mass-assignment for all models
48
- # in your app. As such, your models will need to explicitly whitelist or blacklist accessible
49
- # parameters by using an attr_accessible or attr_protected declaration.
50
- config.active_record.whitelist_attributes = true
51
-
52
- # Enable the asset pipeline
53
- config.assets.enabled = true
54
-
55
- # Version of your assets, change this if you want to expire all your assets
56
- config.assets.version = '1.0'
18
+ config.i18n.default_locale = :en
19
+ config.i18n.available_locales = [:en, :de]
57
20
  end
58
21
  end
59
22
 
@@ -1,10 +1,3 @@
1
- require 'rubygems'
2
- gemfile = File.expand_path('../../../../Gemfile', __FILE__)
1
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
3
2
 
4
- if File.exist?(gemfile)
5
- ENV['BUNDLE_GEMFILE'] = gemfile
6
- require 'bundler'
7
- Bundler.setup
8
- end
9
-
10
- $:.unshift File.expand_path('../../../../lib', __FILE__)
3
+ require 'bundler/setup' # Set up gems listed in the Gemfile.
@@ -0,0 +1,9 @@
1
+ development:
2
+ adapter: async
3
+
4
+ test:
5
+ adapter: async
6
+
7
+ production:
8
+ adapter: redis
9
+ url: redis://localhost:6379/1
@@ -1,37 +1,42 @@
1
1
  Dummy::Application.configure do
2
- # Settings specified here will take precedence over those in config/application.rb
2
+ # Settings specified here will take precedence over those in config/application.rb.
3
3
 
4
4
  # In the development environment your application's code is reloaded on
5
5
  # every request. This slows down response time but is perfect for development
6
6
  # since you don't have to restart the web server when you make code changes.
7
7
  config.cache_classes = false
8
8
 
9
- # Log error messages when you accidentally call methods on nil.
10
- config.whiny_nils = true
9
+ # Do not eager load code on boot.
10
+ config.eager_load = false
11
11
 
12
- # Show full error reports and disable caching
13
- config.consider_all_requests_local = true
14
- config.action_controller.perform_caching = false
12
+ # Show full error reports.
13
+ config.consider_all_requests_local = true
15
14
 
16
- # Don't care if the mailer can't send
17
- config.action_mailer.raise_delivery_errors = false
15
+ # Enable/disable caching. By default caching is disabled.
16
+ if Rails.root.join('tmp/caching-dev.txt').exist?
17
+ config.action_controller.perform_caching = true
18
18
 
19
- # Print deprecation notices to the Rails logger
20
- config.active_support.deprecation = :log
19
+ config.cache_store = :memory_store
20
+ config.public_file_server.headers = {
21
+ 'Cache-Control' => 'public, max-age=172800'
22
+ }
23
+ else
24
+ config.action_controller.perform_caching = false
21
25
 
22
- # Only use best-standards-support built into browsers
23
- config.action_dispatch.best_standards_support = :builtin
26
+ config.cache_store = :null_store
27
+ end
24
28
 
25
- # Raise exception on mass assignment protection for Active Record models
26
- config.active_record.mass_assignment_sanitizer = :strict
29
+ # Print deprecation notices to the Rails logger.
30
+ config.active_support.deprecation = :log
27
31
 
28
- # Log the query plan for queries taking more than this (works
29
- # with SQLite, MySQL, and PostgreSQL)
30
- config.active_record.auto_explain_threshold_in_seconds = 0.5
32
+ # Debug mode disables concatenation and preprocessing of assets.
33
+ # This option may cause significant delays in view rendering with a large
34
+ # number of complex assets.
35
+ # config.assets.debug = true
31
36
 
32
- # Do not compress assets
33
- config.assets.compress = false
37
+ # Suppress logger output for asset requests.
38
+ # config.assets.quiet = true
34
39
 
35
- # Expands the lines which load the assets
36
- config.assets.debug = true
40
+ # Raises error for missing translations
41
+ # config.action_view.raise_on_missing_translations = true
37
42
  end
@@ -4,6 +4,9 @@ Dummy::Application.configure do
4
4
  # Code is not reloaded between requests
5
5
  config.cache_classes = true
6
6
 
7
+ # Do not eager load code on boot.
8
+ config.eager_load = true
9
+
7
10
  # Full error reports are disabled and caching is turned on
8
11
  config.consider_all_requests_local = false
9
12
  config.action_controller.perform_caching = true
@@ -1,5 +1,5 @@
1
1
  Dummy::Application.configure do
2
- # Settings specified here will take precedence over those in config/application.rb
2
+ # Settings specified here will take precedence over those in config/application.rb.
3
3
 
4
4
  # The test environment is used exclusively to run your application's
5
5
  # test suite. You never need to work with it otherwise. Remember that
@@ -7,31 +7,27 @@ Dummy::Application.configure do
7
7
  # and recreated between test runs. Don't rely on the data there!
8
8
  config.cache_classes = true
9
9
 
10
- # Configure static asset server for tests with Cache-Control for performance
11
- config.serve_static_assets = true
12
- config.static_cache_control = "public, max-age=3600"
10
+ # Do not eager load code on boot. This avoids loading your whole application
11
+ # just for the purpose of running a single test. If you are using a tool that
12
+ # preloads Rails for running tests, you may have to set it to true.
13
+ config.eager_load = false
13
14
 
14
- # Log error messages when you accidentally call methods on nil
15
- config.whiny_nils = true
15
+ # Configure public file server for tests with Cache-Control for performance.
16
+ config.public_file_server.enabled = true
17
+ config.public_file_server.headers = {
18
+ 'Cache-Control' => 'public, max-age=3600'
19
+ }
16
20
 
17
- # Show full error reports and disable caching
21
+ # Show full error reports and disable caching.
18
22
  config.consider_all_requests_local = true
19
23
  config.action_controller.perform_caching = false
20
24
 
21
- # Raise exceptions instead of rendering exception templates
25
+ # Raise exceptions instead of rendering exception templates.
22
26
  config.action_dispatch.show_exceptions = false
23
27
 
24
- # Disable request forgery protection in test environment
25
- config.action_controller.allow_forgery_protection = false
28
+ # Disable request forgery protection in test environment.
29
+ config.action_controller.allow_forgery_protection = false
26
30
 
27
- # Tell Action Mailer not to deliver emails to the real world.
28
- # The :test delivery method accumulates sent emails in the
29
- # ActionMailer::Base.deliveries array.
30
- config.action_mailer.delivery_method = :test
31
-
32
- # Raise exception on mass assignment protection for Active Record models
33
- config.active_record.mass_assignment_sanitizer = :strict
34
-
35
- # Print deprecation notices to the stderr
31
+ # Print deprecation notices to the stderr.
36
32
  config.active_support.deprecation = :stderr
37
33
  end
@@ -0,0 +1,6 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # ApplicationController.renderer.defaults.merge!(
4
+ # http_host: 'example.org',
5
+ # https: false
6
+ # )
@@ -0,0 +1,5 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Specify a serializer for the signed and encrypted cookie jars.
4
+ # Valid options are :json, :marshal, and :hybrid.
5
+ Rails.application.config.action_dispatch.cookies_serializer = :marshal
@@ -0,0 +1,4 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Configure sensitive parameters which will be filtered from the log file.
4
+ Rails.application.config.filter_parameters += [:password]
@@ -1,15 +1,16 @@
1
1
  # Be sure to restart your server when you modify this file.
2
2
 
3
- # Add new inflection rules using the following format
4
- # (all these examples are active by default):
5
- # ActiveSupport::Inflector.inflections do |inflect|
3
+ # Add new inflection rules using the following format. Inflections
4
+ # are locale specific, and you may define rules for as many different
5
+ # locales as you wish. All of these examples are active by default:
6
+ # ActiveSupport::Inflector.inflections(:en) do |inflect|
6
7
  # inflect.plural /^(ox)$/i, '\1en'
7
8
  # inflect.singular /^(ox)en/i, '\1'
8
9
  # inflect.irregular 'person', 'people'
9
10
  # inflect.uncountable %w( fish sheep )
10
11
  # end
11
- #
12
+
12
13
  # These inflection rules are supported but not enabled by default:
13
- # ActiveSupport::Inflector.inflections do |inflect|
14
+ # ActiveSupport::Inflector.inflections(:en) do |inflect|
14
15
  # inflect.acronym 'RESTful'
15
16
  # end
@@ -2,4 +2,3 @@
2
2
 
3
3
  # Add new mime types for use in respond_to blocks:
4
4
  # Mime::Type.register "text/richtext", :rtf
5
- # Mime::Type.register_alias "text/html", :iphone
@@ -0,0 +1,20 @@
1
+ # Be sure to restart your server when you modify this file.
2
+ #
3
+ # This file contains migration options to ease your Rails 5.0 upgrade.
4
+ #
5
+ # Once upgraded flip defaults one by one to migrate to the new default.
6
+ #
7
+ # Read the Rails 5.0 release notes for more info on each option.
8
+
9
+ # Enable per-form CSRF tokens. Previous versions had false.
10
+ Rails.application.config.action_controller.per_form_csrf_tokens = false
11
+
12
+ # Enable origin-checking CSRF mitigation. Previous versions had false.
13
+ Rails.application.config.action_controller.forgery_protection_origin_check = false
14
+
15
+ # Make Ruby 2.4 preserve the timezone of the receiver when calling `to_time`.
16
+ # Previous versions had false.
17
+ ActiveSupport.to_time_preserves_timezone = false
18
+
19
+ # Require `belongs_to` associations by default. Previous versions had false.
20
+ # Rails.application.config.active_record.belongs_to_required_by_default = false
@@ -1,8 +1,3 @@
1
1
  # Be sure to restart your server when you modify this file.
2
2
 
3
- Dummy::Application.config.session_store :cookie_store, key: '_dummy_session'
4
-
5
- # Use the database for sessions instead of the cookie-based default,
6
- # which shouldn't be used to store highly confidential information
7
- # (create the session table with "rails generate session_migration")
8
- # Dummy::Application.config.session_store :active_record_store
3
+ Rails.application.config.session_store :cookie_store, key: '_dummy_session'
@@ -1,5 +1,5 @@
1
1
  # Be sure to restart your server when you modify this file.
2
- #
2
+
3
3
  # This file contains settings for ActionController::ParamsWrapper which
4
4
  # is enabled by default.
5
5
 
@@ -8,7 +8,7 @@ ActiveSupport.on_load(:action_controller) do
8
8
  wrap_parameters format: [:json]
9
9
  end
10
10
 
11
- # Disable root element in JSON by default.
12
- ActiveSupport.on_load(:active_record) do
13
- self.include_root_in_json = false
14
- end
11
+ # To enable root element in JSON for ActiveRecord objects.
12
+ # ActiveSupport.on_load(:active_record) do
13
+ # self.include_root_in_json = true
14
+ # end
@@ -10,10 +10,10 @@
10
10
  - title: "Logo Design"
11
11
  - title: "Web Development"
12
12
  - title: "Heuere uns an"
13
- redirect: "/kontakt" # links to Contact page
13
+ refer: "/kontakt" # refers to /kontakt
14
14
 
15
15
  - title: "Über uns"
16
- redirect: true # redirects /about to /about/our-team
16
+ refer: true # refers to /uber-uns/unser-team
17
17
  nodes:
18
18
  - title: "Unser Team"
19
19
  layout:
@@ -26,11 +26,11 @@
26
26
  - title: "Partner"
27
27
  nodes:
28
28
  - title: "Daniel Puglisi"
29
- url: "http://danielpuglisi.com"
29
+ refer: "http://danielpuglisi.com"
30
30
  - title: "Codegestalt"
31
- url: "http://codegestalt.com"
31
+ refer: "http://codegestalt.com"
32
32
  - title: "Kreatify"
33
- url: "http://kreatify.com"
33
+ refer: "http://kreatify.com"
34
34
 
35
35
  - title: "Kontakt"
36
36
  - title: "I18n"