rails_admin_content_builder 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +15 -0
- data/.rspec +4 -0
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/.travis.yml +8 -0
- data/CODE_OF_CONDUCT.md +49 -0
- data/Gemfile +12 -0
- data/LICENSE.txt +21 -0
- data/README.md +129 -0
- data/Rakefile +21 -0
- data/app/assets/images/cb-image-default.jpg +0 -0
- data/app/assets/images/cb-loading.svg +1 -0
- data/app/assets/images/cb-snippet-image-text.jpg +0 -0
- data/app/assets/images/cb-snippet-image.jpg +0 -0
- data/app/assets/images/cb-snippet-quote-text.jpg +0 -0
- data/app/assets/images/cb-snippet-quote.jpg +0 -0
- data/app/assets/images/cb-snippet-text-image.jpg +0 -0
- data/app/assets/images/cb-snippet-text-quote.jpg +0 -0
- data/app/assets/images/cb-snippet-text.jpg +0 -0
- data/app/assets/images/cb-snippet-video.jpg +0 -0
- data/app/assets/images/cb-video-default.jpg +0 -0
- data/app/assets/javascripts/rails_admin/content_builder.js.erb +295 -0
- data/app/assets/stylesheets/rails_admin/content_builder.scss +238 -0
- data/app/controllers/rails_admin_content_builder/content_builder_controller.rb +19 -0
- data/app/helpers/rails_admin_content_builder/content_builder_helpers.rb +32 -0
- data/app/models/rails_admin_content_builder/content_builder.rb +27 -0
- data/app/models/rails_admin_content_builder/content_builder_category.rb +12 -0
- data/app/models/rails_admin_content_builder/content_builder_image.rb +10 -0
- data/app/views/.gitkeep +0 -0
- data/app/views/rails_admin/main/content_builder.html.erb +42 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/config/initializers/assets.rb +11 -0
- data/config/locales/content_builder.en.yml +17 -0
- data/config/locales/content_builder.pt-BR.yml +17 -0
- data/config/routes.rb +5 -0
- data/lib/generators/rails_admin_content_builder_generator.rb +32 -0
- data/lib/generators/templates/content_builder_image_uploader.rb +54 -0
- data/lib/generators/templates/create_content_builder_category_migration.rb +10 -0
- data/lib/generators/templates/create_content_builder_image_migration.rb +10 -0
- data/lib/generators/templates/create_content_builder_migration.rb +16 -0
- data/lib/generators/templates/rails_admin_content_builder.rb +37 -0
- data/lib/rails_admin_content_builder.rb +55 -0
- data/lib/rails_admin_content_builder/engine.rb +26 -0
- data/lib/rails_admin_content_builder/version.rb +3 -0
- data/rails_admin_content_builder.gemspec +42 -0
- data/screenshot/image1.png +0 -0
- data/spec/controllers/rails_admin_content_builder/content_builder_controller_spec.rb +19 -0
- data/spec/dummy/Gemfile +11 -0
- data/spec/dummy/Gemfile.lock +217 -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/uploaders/content_builder_image_uploader.rb +54 -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/bin/setup +29 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/config/application.rb +31 -0
- data/spec/dummy/config/boot.rb +5 -0
- data/spec/dummy/config/database.yml +25 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +41 -0
- data/spec/dummy/config/environments/production.rb +79 -0
- data/spec/dummy/config/environments/test.rb +42 -0
- data/spec/dummy/config/initializers/assets.rb +11 -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 +4 -0
- data/spec/dummy/config/initializers/rails_admin.rb +37 -0
- data/spec/dummy/config/initializers/rails_admin_content_builder.rb +37 -0
- data/spec/dummy/config/initializers/session_store.rb +3 -0
- data/spec/dummy/config/initializers/simple_form.rb +165 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +23 -0
- data/spec/dummy/config/locales/simple_form.en.yml +31 -0
- data/spec/dummy/config/routes.rb +57 -0
- data/spec/dummy/config/secrets.yml +22 -0
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/migrate/20160713200802_create_content_builder_categories.rb +10 -0
- data/spec/dummy/db/migrate/20160713200803_create_content_builders.rb +15 -0
- data/spec/dummy/db/migrate/20160713200804_create_content_builder_images.rb +10 -0
- data/spec/dummy/db/schema.rb +46 -0
- data/spec/dummy/lib/templates/erb/scaffold/_form.html.erb +13 -0
- data/spec/dummy/log/development.log +1182 -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/rails_admin_content_builder/content_builder_image/image/1/center_example.jpg +0 -0
- data/spec/dummy/public/uploads/rails_admin_content_builder/content_builder_image/image/1/example.jpg +0 -0
- data/spec/dummy/public/uploads/rails_admin_content_builder/content_builder_image/image/1/left_or_right_example.jpg +0 -0
- data/spec/dummy/public/uploads/rails_admin_content_builder/content_builder_image/image/2/center_example.jpg +0 -0
- data/spec/dummy/public/uploads/rails_admin_content_builder/content_builder_image/image/2/example.jpg +0 -0
- data/spec/dummy/public/uploads/rails_admin_content_builder/content_builder_image/image/2/left_or_right_example.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1461693110-14578-0001-7683/center_example.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1461693110-14578-0001-7683/example.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1461693110-14578-0001-7683/left_or_right_example.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1461693202-14651-0001-6505/center_example.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1461693202-14651-0001-6505/example.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1461693202-14651-0001-6505/left_or_right_example.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1461693245-14728-0001-4392/center_example.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1461693245-14728-0001-4392/example.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/1461693245-14728-0001-4392/left_or_right_example.jpg +0 -0
- data/spec/factories/content_builder_categories.rb +5 -0
- data/spec/factories/content_builder_images.rb +6 -0
- data/spec/factories/content_builders.rb +10 -0
- data/spec/features/create_content_builder_category_spec.rb +18 -0
- data/spec/features/create_content_builder_spec.rb +34 -0
- data/spec/features/status_content_builder_spec.rb +28 -0
- data/spec/fixtures/assets/example.jpg +0 -0
- data/spec/helpers/rails_admin_content_builder/content_builder_helper_spec.rb +33 -0
- data/spec/models/rails_admin_content_builder/content_builder_category_spec.rb +11 -0
- data/spec/models/rails_admin_content_builder/content_builder_image_spec.rb +11 -0
- data/spec/models/rails_admin_content_builder/content_builder_spec.rb +44 -0
- data/spec/spec_helper.rb +36 -0
- data/spec/version_spec.rb +7 -0
- data/vendor/assets/stylesheets/rails_admin_content_builder.scss +214 -0
- metadata +3100 -0
@@ -0,0 +1,37 @@
|
|
1
|
+
RailsAdmin.config do |config|
|
2
|
+
|
3
|
+
### Popular gems integration
|
4
|
+
|
5
|
+
## == Devise ==
|
6
|
+
# config.authenticate_with do
|
7
|
+
# warden.authenticate! scope: :user
|
8
|
+
# end
|
9
|
+
# config.current_user_method(&:current_user)
|
10
|
+
|
11
|
+
## == Cancan ==
|
12
|
+
# config.authorize_with :cancan
|
13
|
+
|
14
|
+
## == Pundit ==
|
15
|
+
# config.authorize_with :pundit
|
16
|
+
|
17
|
+
## == PaperTrail ==
|
18
|
+
# config.audit_with :paper_trail, 'User', 'PaperTrail::Version' # PaperTrail >= 3.0.0
|
19
|
+
|
20
|
+
### More at https://github.com/sferik/rails_admin/wiki/Base-configuration
|
21
|
+
|
22
|
+
config.actions do
|
23
|
+
dashboard # mandatory
|
24
|
+
index # mandatory
|
25
|
+
new
|
26
|
+
export
|
27
|
+
bulk_delete
|
28
|
+
show
|
29
|
+
edit
|
30
|
+
delete
|
31
|
+
show_in_app
|
32
|
+
|
33
|
+
## With an audit adapter, you can add:
|
34
|
+
# history_index
|
35
|
+
# history_show
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
RailsAdmin.config do |config|
|
2
|
+
config.actions do
|
3
|
+
content_builder do
|
4
|
+
only ['RailsAdminContentBuilder::ContentBuilder']
|
5
|
+
end
|
6
|
+
|
7
|
+
config.model 'RailsAdminContentBuilder::ContentBuilder' do
|
8
|
+
list do
|
9
|
+
field :id
|
10
|
+
field :title
|
11
|
+
field :date_publish
|
12
|
+
field :content_builder_category
|
13
|
+
field :status
|
14
|
+
end
|
15
|
+
edit do
|
16
|
+
field :title
|
17
|
+
field :date_publish
|
18
|
+
field :written_by
|
19
|
+
field :content_builder_category
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
config.model 'RailsAdminContentBuilder::ContentBuilderCategory' do
|
24
|
+
list do
|
25
|
+
field :id
|
26
|
+
field :name
|
27
|
+
end
|
28
|
+
edit do
|
29
|
+
field :name
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
config.model 'RailsAdminContentBuilder::ContentBuilderImage' do
|
34
|
+
visible false
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,165 @@
|
|
1
|
+
# Use this setup block to configure all options available in SimpleForm.
|
2
|
+
SimpleForm.setup do |config|
|
3
|
+
# Wrappers are used by the form builder to generate a
|
4
|
+
# complete input. You can remove any component from the
|
5
|
+
# wrapper, change the order or even add your own to the
|
6
|
+
# stack. The options given below are used to wrap the
|
7
|
+
# whole input.
|
8
|
+
config.wrappers :default, class: :input,
|
9
|
+
hint_class: :field_with_hint, error_class: :field_with_errors do |b|
|
10
|
+
## Extensions enabled by default
|
11
|
+
# Any of these extensions can be disabled for a
|
12
|
+
# given input by passing: `f.input EXTENSION_NAME => false`.
|
13
|
+
# You can make any of these extensions optional by
|
14
|
+
# renaming `b.use` to `b.optional`.
|
15
|
+
|
16
|
+
# Determines whether to use HTML5 (:email, :url, ...)
|
17
|
+
# and required attributes
|
18
|
+
b.use :html5
|
19
|
+
|
20
|
+
# Calculates placeholders automatically from I18n
|
21
|
+
# You can also pass a string as f.input placeholder: "Placeholder"
|
22
|
+
b.use :placeholder
|
23
|
+
|
24
|
+
## Optional extensions
|
25
|
+
# They are disabled unless you pass `f.input EXTENSION_NAME => true`
|
26
|
+
# to the input. If so, they will retrieve the values from the model
|
27
|
+
# if any exists. If you want to enable any of those
|
28
|
+
# extensions by default, you can change `b.optional` to `b.use`.
|
29
|
+
|
30
|
+
# Calculates maxlength from length validations for string inputs
|
31
|
+
b.optional :maxlength
|
32
|
+
|
33
|
+
# Calculates pattern from format validations for string inputs
|
34
|
+
b.optional :pattern
|
35
|
+
|
36
|
+
# Calculates min and max from length validations for numeric inputs
|
37
|
+
b.optional :min_max
|
38
|
+
|
39
|
+
# Calculates readonly automatically from readonly attributes
|
40
|
+
b.optional :readonly
|
41
|
+
|
42
|
+
## Inputs
|
43
|
+
b.use :label_input
|
44
|
+
b.use :hint, wrap_with: { tag: :span, class: :hint }
|
45
|
+
b.use :error, wrap_with: { tag: :span, class: :error }
|
46
|
+
|
47
|
+
## full_messages_for
|
48
|
+
# If you want to display the full error message for the attribute, you can
|
49
|
+
# use the component :full_error, like:
|
50
|
+
#
|
51
|
+
# b.use :full_error, wrap_with: { tag: :span, class: :error }
|
52
|
+
end
|
53
|
+
|
54
|
+
# The default wrapper to be used by the FormBuilder.
|
55
|
+
config.default_wrapper = :default
|
56
|
+
|
57
|
+
# Define the way to render check boxes / radio buttons with labels.
|
58
|
+
# Defaults to :nested for bootstrap config.
|
59
|
+
# inline: input + label
|
60
|
+
# nested: label > input
|
61
|
+
config.boolean_style = :nested
|
62
|
+
|
63
|
+
# Default class for buttons
|
64
|
+
config.button_class = 'btn'
|
65
|
+
|
66
|
+
# Method used to tidy up errors. Specify any Rails Array method.
|
67
|
+
# :first lists the first message for each field.
|
68
|
+
# Use :to_sentence to list all errors for each field.
|
69
|
+
# config.error_method = :first
|
70
|
+
|
71
|
+
# Default tag used for error notification helper.
|
72
|
+
config.error_notification_tag = :div
|
73
|
+
|
74
|
+
# CSS class to add for error notification helper.
|
75
|
+
config.error_notification_class = 'error_notification'
|
76
|
+
|
77
|
+
# ID to add for error notification helper.
|
78
|
+
# config.error_notification_id = nil
|
79
|
+
|
80
|
+
# Series of attempts to detect a default label method for collection.
|
81
|
+
# config.collection_label_methods = [ :to_label, :name, :title, :to_s ]
|
82
|
+
|
83
|
+
# Series of attempts to detect a default value method for collection.
|
84
|
+
# config.collection_value_methods = [ :id, :to_s ]
|
85
|
+
|
86
|
+
# You can wrap a collection of radio/check boxes in a pre-defined tag, defaulting to none.
|
87
|
+
# config.collection_wrapper_tag = nil
|
88
|
+
|
89
|
+
# You can define the class to use on all collection wrappers. Defaulting to none.
|
90
|
+
# config.collection_wrapper_class = nil
|
91
|
+
|
92
|
+
# You can wrap each item in a collection of radio/check boxes with a tag,
|
93
|
+
# defaulting to :span.
|
94
|
+
# config.item_wrapper_tag = :span
|
95
|
+
|
96
|
+
# You can define a class to use in all item wrappers. Defaulting to none.
|
97
|
+
# config.item_wrapper_class = nil
|
98
|
+
|
99
|
+
# How the label text should be generated altogether with the required text.
|
100
|
+
# config.label_text = lambda { |label, required, explicit_label| "#{required} #{label}" }
|
101
|
+
|
102
|
+
# You can define the class to use on all labels. Default is nil.
|
103
|
+
# config.label_class = nil
|
104
|
+
|
105
|
+
# You can define the default class to be used on forms. Can be overriden
|
106
|
+
# with `html: { :class }`. Defaulting to none.
|
107
|
+
# config.default_form_class = nil
|
108
|
+
|
109
|
+
# You can define which elements should obtain additional classes
|
110
|
+
# config.generate_additional_classes_for = [:wrapper, :label, :input]
|
111
|
+
|
112
|
+
# Whether attributes are required by default (or not). Default is true.
|
113
|
+
# config.required_by_default = true
|
114
|
+
|
115
|
+
# Tell browsers whether to use the native HTML5 validations (novalidate form option).
|
116
|
+
# These validations are enabled in SimpleForm's internal config but disabled by default
|
117
|
+
# in this configuration, which is recommended due to some quirks from different browsers.
|
118
|
+
# To stop SimpleForm from generating the novalidate option, enabling the HTML5 validations,
|
119
|
+
# change this configuration to true.
|
120
|
+
config.browser_validations = false
|
121
|
+
|
122
|
+
# Collection of methods to detect if a file type was given.
|
123
|
+
# config.file_methods = [ :mounted_as, :file?, :public_filename ]
|
124
|
+
|
125
|
+
# Custom mappings for input types. This should be a hash containing a regexp
|
126
|
+
# to match as key, and the input type that will be used when the field name
|
127
|
+
# matches the regexp as value.
|
128
|
+
# config.input_mappings = { /count/ => :integer }
|
129
|
+
|
130
|
+
# Custom wrappers for input types. This should be a hash containing an input
|
131
|
+
# type as key and the wrapper that will be used for all inputs with specified type.
|
132
|
+
# config.wrapper_mappings = { string: :prepend }
|
133
|
+
|
134
|
+
# Namespaces where SimpleForm should look for custom input classes that
|
135
|
+
# override default inputs.
|
136
|
+
# config.custom_inputs_namespaces << "CustomInputs"
|
137
|
+
|
138
|
+
# Default priority for time_zone inputs.
|
139
|
+
# config.time_zone_priority = nil
|
140
|
+
|
141
|
+
# Default priority for country inputs.
|
142
|
+
# config.country_priority = nil
|
143
|
+
|
144
|
+
# When false, do not use translations for labels.
|
145
|
+
# config.translate_labels = true
|
146
|
+
|
147
|
+
# Automatically discover new inputs in Rails' autoload path.
|
148
|
+
# config.inputs_discovery = true
|
149
|
+
|
150
|
+
# Cache SimpleForm inputs discovery
|
151
|
+
# config.cache_discovery = !Rails.env.development?
|
152
|
+
|
153
|
+
# Default class for inputs
|
154
|
+
# config.input_class = nil
|
155
|
+
|
156
|
+
# Define the default class of the input wrapper of the boolean input.
|
157
|
+
config.boolean_label_class = 'checkbox'
|
158
|
+
|
159
|
+
# Defines if the default input wrapper class should be included in radio
|
160
|
+
# collection wrappers.
|
161
|
+
# config.include_default_input_wrapper_class = true
|
162
|
+
|
163
|
+
# Defines which i18n scope will be used in Simple Form.
|
164
|
+
# config.i18n_scope = 'simple_form'
|
165
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# This file contains settings for ActionController::ParamsWrapper which
|
4
|
+
# is enabled by default.
|
5
|
+
|
6
|
+
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
|
7
|
+
ActiveSupport.on_load(:action_controller) do
|
8
|
+
wrap_parameters format: [:json] if respond_to?(:wrap_parameters)
|
9
|
+
end
|
10
|
+
|
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
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# Files in the config/locales directory are used for internationalization
|
2
|
+
# and are automatically loaded by Rails. If you want to use locales other
|
3
|
+
# than English, add the necessary files in this directory.
|
4
|
+
#
|
5
|
+
# To use the locales, use `I18n.t`:
|
6
|
+
#
|
7
|
+
# I18n.t 'hello'
|
8
|
+
#
|
9
|
+
# In views, this is aliased to just `t`:
|
10
|
+
#
|
11
|
+
# <%= t('hello') %>
|
12
|
+
#
|
13
|
+
# To use a different locale, set it with `I18n.locale`:
|
14
|
+
#
|
15
|
+
# I18n.locale = :es
|
16
|
+
#
|
17
|
+
# This would use the information in config/locales/es.yml.
|
18
|
+
#
|
19
|
+
# To learn more, please read the Rails Internationalization guide
|
20
|
+
# available at http://guides.rubyonrails.org/i18n.html.
|
21
|
+
|
22
|
+
en:
|
23
|
+
hello: "Hello world"
|
@@ -0,0 +1,31 @@
|
|
1
|
+
en:
|
2
|
+
simple_form:
|
3
|
+
"yes": 'Yes'
|
4
|
+
"no": 'No'
|
5
|
+
required:
|
6
|
+
text: 'required'
|
7
|
+
mark: '*'
|
8
|
+
# You can uncomment the line below if you need to overwrite the whole required html.
|
9
|
+
# When using html, text and mark won't be used.
|
10
|
+
# html: '<abbr title="required">*</abbr>'
|
11
|
+
error_notification:
|
12
|
+
default_message: "Please review the problems below:"
|
13
|
+
# Examples
|
14
|
+
# labels:
|
15
|
+
# defaults:
|
16
|
+
# password: 'Password'
|
17
|
+
# user:
|
18
|
+
# new:
|
19
|
+
# email: 'E-mail to sign in.'
|
20
|
+
# edit:
|
21
|
+
# email: 'E-mail.'
|
22
|
+
# hints:
|
23
|
+
# defaults:
|
24
|
+
# username: 'User name to sign in.'
|
25
|
+
# password: 'No special characters, please.'
|
26
|
+
# include_blanks:
|
27
|
+
# defaults:
|
28
|
+
# age: 'Rather not say'
|
29
|
+
# prompts:
|
30
|
+
# defaults:
|
31
|
+
# age: 'Select your age'
|
@@ -0,0 +1,57 @@
|
|
1
|
+
Rails.application.routes.draw do
|
2
|
+
mount RailsAdmin::Engine => '/admin', as: 'rails_admin'
|
3
|
+
# The priority is based upon order of creation: first created -> highest priority.
|
4
|
+
# See how all your routes lay out with "rake routes".
|
5
|
+
|
6
|
+
# You can have the root of your site routed with "root"
|
7
|
+
# root 'home#index'
|
8
|
+
|
9
|
+
# Example of regular route:
|
10
|
+
# get 'products/:id' => 'catalog#view'
|
11
|
+
|
12
|
+
# Example of named route that can be invoked with purchase_url(id: product.id)
|
13
|
+
# get 'products/:id/purchase' => 'catalog#purchase', as: :purchase
|
14
|
+
|
15
|
+
# Example resource route (maps HTTP verbs to controller actions automatically):
|
16
|
+
# resources :products
|
17
|
+
|
18
|
+
# Example resource route with options:
|
19
|
+
# resources :products do
|
20
|
+
# member do
|
21
|
+
# get 'short'
|
22
|
+
# post 'toggle'
|
23
|
+
# end
|
24
|
+
#
|
25
|
+
# collection do
|
26
|
+
# get 'sold'
|
27
|
+
# end
|
28
|
+
# end
|
29
|
+
|
30
|
+
# Example resource route with sub-resources:
|
31
|
+
# resources :products do
|
32
|
+
# resources :comments, :sales
|
33
|
+
# resource :seller
|
34
|
+
# end
|
35
|
+
|
36
|
+
# Example resource route with more complex sub-resources:
|
37
|
+
# resources :products do
|
38
|
+
# resources :comments
|
39
|
+
# resources :sales do
|
40
|
+
# get 'recent', on: :collection
|
41
|
+
# end
|
42
|
+
# end
|
43
|
+
|
44
|
+
# Example resource route with concerns:
|
45
|
+
# concern :toggleable do
|
46
|
+
# post 'toggle'
|
47
|
+
# end
|
48
|
+
# resources :posts, concerns: :toggleable
|
49
|
+
# resources :photos, concerns: :toggleable
|
50
|
+
|
51
|
+
# Example resource route within a namespace:
|
52
|
+
# namespace :admin do
|
53
|
+
# # Directs /admin/products/* to Admin::ProductsController
|
54
|
+
# # (app/controllers/admin/products_controller.rb)
|
55
|
+
# resources :products
|
56
|
+
# end
|
57
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# Your secret key is used for verifying the integrity of signed cookies.
|
4
|
+
# If you change this key, all old signed cookies will become invalid!
|
5
|
+
|
6
|
+
# Make sure the secret is at least 30 characters and all random,
|
7
|
+
# no regular words or you'll be exposed to dictionary attacks.
|
8
|
+
# You can use `rake secret` to generate a secure secret key.
|
9
|
+
|
10
|
+
# Make sure the secrets in this file are kept private
|
11
|
+
# if you're sharing your code publicly.
|
12
|
+
|
13
|
+
development:
|
14
|
+
secret_key_base: 652c59d87527630f05640f982ebd434fc8103da01c544f4728f51f10db5ae1c5fba731e47790e4a612e2735315b67b033cd8c563095614614b1cb4d4a1658219
|
15
|
+
|
16
|
+
test:
|
17
|
+
secret_key_base: be662225f08cb02ddb726ae9d671006d0859424c0789e01598748247032abd15eb0383a8c955eebbbc37014f59485729206d331b80718964dcbb47126ed81551
|
18
|
+
|
19
|
+
# Do not keep production secrets in the repository,
|
20
|
+
# instead read values from the environment.
|
21
|
+
production:
|
22
|
+
secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
|
Binary file
|
@@ -0,0 +1,15 @@
|
|
1
|
+
class CreateContentBuilders < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :content_builders do |t|
|
4
|
+
t.string :title
|
5
|
+
t.string :written_by
|
6
|
+
t.datetime :date_publish
|
7
|
+
t.text :content
|
8
|
+
t.boolean :status, default: false
|
9
|
+
t.string :slug
|
10
|
+
t.references :content_builder_category, index: true, foreign_key: true
|
11
|
+
|
12
|
+
t.timestamps null: false
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|