seiten 0.0.7 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/Rakefile +1 -0
- data/app/controllers/seiten/pages_controller.rb +2 -19
- data/config/initializers/seiten.rb +1 -1
- data/lib/seiten/errors/base_error.rb +4 -0
- data/lib/seiten/errors/page_error.rb +4 -0
- data/lib/seiten/errors/routing_error.rb +7 -0
- data/lib/seiten/helpers/backend.rb +23 -0
- data/lib/seiten/helpers/current.rb +33 -0
- data/lib/seiten/helpers/frontend.rb +19 -0
- data/lib/seiten/html/breadcrumb.rb +41 -0
- data/lib/seiten/html/helpers.rb +32 -0
- data/lib/seiten/html/navigation.rb +39 -0
- data/lib/seiten/navigation.rb +43 -0
- data/lib/seiten/page.rb +71 -49
- data/lib/seiten/page_collection.rb +54 -0
- data/lib/seiten/page_collection_builder.rb +63 -0
- data/lib/seiten/railtie.rb +7 -0
- data/lib/seiten/routes_helper.rb +16 -11
- data/lib/seiten/slug_builder.rb +32 -0
- data/lib/seiten/version.rb +1 -1
- data/lib/seiten.rb +63 -13
- data/test/controllers/helper_methods_test.rb +25 -0
- data/test/controllers/pages_controller_test.rb +9 -0
- data/test/controllers/posts_controller_test.rb +12 -0
- data/test/controllers/seiten/pages_controller_test.rb +39 -0
- data/test/dummy/app/controllers/application_controller.rb +10 -0
- data/test/dummy/app/controllers/pages_controller.rb +1 -1
- data/test/dummy/app/controllers/posts_controller.rb +10 -0
- data/test/dummy/app/helpers/application_helper.rb +1 -0
- data/test/dummy/app/pages/{de → application/de}/produkte.html.erb +0 -0
- data/test/dummy/app/pages/{en/about/our-team/switzerland.html.erb → application/en/about/our-team/italy.html.erb} +0 -0
- data/test/dummy/app/pages/{en/about/works.html.erb → application/en/about/our-team/switzerland.html.erb} +0 -0
- data/test/dummy/app/pages/application/en/about/our-team.html.erb +2 -0
- data/test/dummy/app/pages/application/en/about/partners.html.erb +1 -0
- data/test/dummy/app/pages/{en/contact.html.erb → application/en/about/works.html.erb} +0 -0
- data/test/dummy/app/pages/{en/about/our-team/italy.html.erb → application/en/about.html.erb} +0 -0
- data/test/dummy/app/pages/{en/products/logo-design.html.erb → application/en/contact.html.erb} +0 -0
- data/test/dummy/app/pages/{en → application/en}/home.html.erb +0 -0
- data/test/dummy/app/pages/{en/products/web-development.html.erb → application/en/products/hire-us.html.erb} +0 -0
- data/test/dummy/{db/test.sqlite3 → app/pages/application/en/products/logo-design.html.erb} +0 -0
- data/test/dummy/app/pages/application/en/products/web-development.html.erb +0 -0
- data/test/dummy/app/pages/{en → application/en}/products.html.erb +0 -0
- data/test/dummy/app/pages/{localization.html.erb → application/localization.html.erb} +0 -0
- data/test/dummy/app/pages/help/en/home.html.erb +0 -0
- data/test/dummy/app/pages/help/en/logging-in.html.erb +0 -0
- data/test/dummy/app/views/layouts/application.html.erb +1 -1
- data/test/dummy/app/views/layouts/home.html.erb +1 -1
- data/test/dummy/app/views/pages/secret.html.erb +1 -1
- data/test/dummy/app/views/posts/index.html.erb +1 -0
- data/test/dummy/config/application.rb +4 -41
- data/test/dummy/config/boot.rb +2 -9
- data/test/dummy/config/cable.yml +9 -0
- data/test/dummy/config/environments/development.rb +26 -21
- data/test/dummy/config/environments/production.rb +3 -0
- data/test/dummy/config/environments/test.rb +15 -19
- data/test/dummy/config/initializers/application_controller_renderer.rb +6 -0
- data/test/dummy/config/initializers/cookies_serializer.rb +5 -0
- data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/test/dummy/config/initializers/inflections.rb +6 -5
- data/test/dummy/config/initializers/mime_types.rb +0 -1
- data/test/dummy/config/initializers/new_framework_defaults.rb +20 -0
- data/test/dummy/config/initializers/session_store.rb +1 -6
- data/test/dummy/config/initializers/wrap_parameters.rb +5 -5
- data/test/dummy/config/{navigation/de.yml → navigations/application.de.yml} +5 -5
- data/test/dummy/config/{navigation.yml → navigations/application.en.yml} +21 -5
- data/test/dummy/config/navigations/help.en.yml +17 -0
- data/test/dummy/config/routes.rb +6 -3
- data/test/dummy/config/secrets.yml +22 -0
- data/test/dummy/log/development.log +1716 -4558
- data/test/dummy/log/test.log +43833 -13898
- data/test/fixtures/breadcrumb.html +1 -0
- data/test/fixtures/navigation.html +1 -0
- data/test/integration/layout_test.rb +10 -11
- data/test/integration/navigation_test.rb +50 -50
- data/test/lib/seiten/helpers/frontend_test.rb +37 -0
- data/test/lib/seiten/html/breadcrumb_test.rb +29 -0
- data/test/lib/seiten/html/helpers_test.rb +55 -0
- data/test/lib/seiten/html/navigation_test.rb +29 -0
- data/test/lib/seiten/navigation_test.rb +45 -0
- data/test/lib/seiten/page_collection_builder_test.rb +141 -0
- data/test/lib/seiten/page_collection_test.rb +59 -0
- data/test/lib/seiten/page_test.rb +188 -0
- data/test/lib/seiten/slug_builder_test.rb +47 -0
- data/test/lib/seiten_test.rb +16 -0
- data/test/test_helper.rb +2 -8
- metadata +147 -93
- data/app/helpers/seiten_helper.rb +0 -46
- data/lib/seiten/controllers/helpers.rb +0 -16
- data/lib/seiten/page_store.rb +0 -160
- data/test/dummy/app/assets/javascripts/application.js +0 -15
- data/test/dummy/app/assets/stylesheets/application.css +0 -13
- data/test/dummy/app/pages/en/about/our-team.html.erb +0 -2
- data/test/dummy/app/pages/en/about/partners.html.erb +0 -1
- data/test/dummy/config/navigation/en.yml +0 -37
- data/test/dummy/db/development.sqlite3 +0 -0
- data/test/dummy/tmp/cache/assets/CD8/370/sprockets%2F357970feca3ac29060c1e3861e2c0953 +0 -0
- data/test/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705 +0 -0
- data/test/dummy/tmp/cache/assets/D5A/EA0/sprockets%2Fd771ace226fc8215a3572e0aa35bb0d6 +0 -0
- data/test/dummy/tmp/pids/server.pid +0 -1
- data/test/integration/i18n_test.rb +0 -31
- data/test/integration/redirect_test.rb +0 -15
- data/test/page_store_test.rb +0 -28
- data/test/page_test.rb +0 -98
- data/test/seiten_test.rb +0 -11
data/lib/seiten.rb
CHANGED
@@ -1,27 +1,77 @@
|
|
1
1
|
require 'seiten/engine'
|
2
|
-
require 'seiten/
|
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
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
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
|
+
}
|
14
45
|
}
|
15
46
|
|
16
|
-
|
17
|
-
|
18
|
-
|
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
|
19
61
|
|
20
|
-
|
21
|
-
|
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
|
22
72
|
end
|
23
73
|
|
24
74
|
ActiveSupport.on_load(:action_controller) do
|
25
|
-
include
|
75
|
+
include Helpers::Current
|
26
76
|
end
|
27
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
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= seiten_navigation(parent_id: current_page.id) %>
|
File without changes
|
data/test/dummy/app/pages/{en/about/our-team/italy.html.erb → application/en/about.html.erb}
RENAMED
File without changes
|
data/test/dummy/app/pages/{en/products/logo-design.html.erb → application/en/contact.html.erb}
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -1 +1 @@
|
|
1
|
-
|
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
|
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
|
-
|
18
|
-
|
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
|
|
data/test/dummy/config/boot.rb
CHANGED
@@ -1,10 +1,3 @@
|
|
1
|
-
|
2
|
-
gemfile = File.expand_path('../../../../Gemfile', __FILE__)
|
1
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
|
3
2
|
|
4
|
-
|
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.
|
@@ -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
|
-
#
|
10
|
-
config.
|
9
|
+
# Do not eager load code on boot.
|
10
|
+
config.eager_load = false
|
11
11
|
|
12
|
-
# Show full error reports
|
13
|
-
config.consider_all_requests_local
|
14
|
-
config.action_controller.perform_caching = false
|
12
|
+
# Show full error reports.
|
13
|
+
config.consider_all_requests_local = true
|
15
14
|
|
16
|
-
#
|
17
|
-
|
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
|
-
|
20
|
-
|
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
|
-
|
23
|
-
|
26
|
+
config.cache_store = :null_store
|
27
|
+
end
|
24
28
|
|
25
|
-
#
|
26
|
-
config.
|
29
|
+
# Print deprecation notices to the Rails logger.
|
30
|
+
config.active_support.deprecation = :log
|
27
31
|
|
28
|
-
#
|
29
|
-
#
|
30
|
-
|
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
|
-
#
|
33
|
-
config.assets.
|
37
|
+
# Suppress logger output for asset requests.
|
38
|
+
# config.assets.quiet = true
|
34
39
|
|
35
|
-
#
|
36
|
-
config.
|
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
|
-
#
|
11
|
-
|
12
|
-
|
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
|
-
#
|
15
|
-
config.
|
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
|
28
|
+
# Disable request forgery protection in test environment.
|
29
|
+
config.action_controller.allow_forgery_protection = false
|
26
30
|
|
27
|
-
#
|
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
|
@@ -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
|
-
#
|
5
|
-
#
|
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
|
@@ -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
|
-
|
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
|
-
#
|
12
|
-
ActiveSupport.on_load(:active_record) do
|
13
|
-
|
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
|
-
|
13
|
+
refer: "/kontakt" # refers to /kontakt
|
14
14
|
|
15
15
|
- title: "Über uns"
|
16
|
-
|
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
|
-
|
29
|
+
refer: "http://danielpuglisi.com"
|
30
30
|
- title: "Codegestalt"
|
31
|
-
|
31
|
+
refer: "http://codegestalt.com"
|
32
32
|
- title: "Kreatify"
|
33
|
-
|
33
|
+
refer: "http://kreatify.com"
|
34
34
|
|
35
35
|
- title: "Kontakt"
|
36
36
|
- title: "I18n"
|