configurable_engine 0.1.1 → 0.1.2
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.
- data/README.md +10 -2
- data/VERSION +1 -1
- data/app/controllers/admin/configurables_controller.rb +2 -14
- data/configurable_engine.gemspec +3 -2
- data/lib/configurable_engine/configurables_controller.rb +15 -0
- data/lib/configurable_engine/engine.rb +4 -0
- data/lib/configurable_engine.rb +2 -4
- metadata +5 -4
- data/app/controllers/admin/application_controller.rb +0 -2
data/README.md
CHANGED
@@ -38,9 +38,17 @@ Since Configurable is an ActiveRecord model, if you want to update the config, c
|
|
38
38
|
|
39
39
|
Configurable comes with a web interface that is available to your app straight away at `http://localhost:3000/admin/configurable`.
|
40
40
|
|
41
|
-
If you want to add a layout, or protect the configurable controller, create `app/controllers/admin/
|
41
|
+
If you want to add a layout, or protect the configurable controller, create `app/controllers/admin/configurables_controller.rb` as such:
|
42
42
|
|
43
|
-
|
43
|
+
bundle exec rails generate controller admin/configurables
|
44
|
+
|
45
|
+
and include `ConfigurableEngine::ConfigurablesController`, eg.
|
46
|
+
|
47
|
+
class Admin::ConfigurablesController < ApplicationController
|
48
|
+
# include the engine controller actions
|
49
|
+
include ConfigurablesController::ConfigurablesController
|
50
|
+
|
51
|
+
# add your own filter(s) / layout
|
44
52
|
before_filter :protect_my_code
|
45
53
|
layout 'admin'
|
46
54
|
end
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.2
|
@@ -1,15 +1,3 @@
|
|
1
|
-
class Admin::ConfigurablesController <
|
2
|
-
|
3
|
-
def show
|
4
|
-
|
5
|
-
end
|
6
|
-
|
7
|
-
def update
|
8
|
-
Configurable.keys.each do |key|
|
9
|
-
Configurable.find_or_create_by_name(key).
|
10
|
-
update_attribute(:value,params[key])
|
11
|
-
end
|
12
|
-
redirect_to admin_configurable_path
|
13
|
-
end
|
14
|
-
|
1
|
+
class Admin::ConfigurablesController < ApplicationController
|
2
|
+
include ConfigurableEngine::ConfigurablesController
|
15
3
|
end
|
data/configurable_engine.gemspec
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{configurable_engine}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.2"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Paul Campbell"]
|
@@ -23,13 +23,14 @@ Gem::Specification.new do |s|
|
|
23
23
|
"README.md",
|
24
24
|
"Rakefile",
|
25
25
|
"VERSION",
|
26
|
-
"app/controllers/admin/application_controller.rb",
|
27
26
|
"app/controllers/admin/configurables_controller.rb",
|
28
27
|
"app/models/configurable.rb",
|
29
28
|
"app/views/admin/configurables/show.html.erb",
|
30
29
|
"config/routes.rb",
|
31
30
|
"configurable_engine.gemspec",
|
32
31
|
"lib/configurable_engine.rb",
|
32
|
+
"lib/configurable_engine/configurables_controller.rb",
|
33
|
+
"lib/configurable_engine/engine.rb",
|
33
34
|
"lib/generators/configurable_engine/install_generator.rb",
|
34
35
|
"lib/generators/configurable_engine/templates/configurable.yml",
|
35
36
|
"lib/generators/configurable_engine/templates/migration.rb"
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module ConfigurableEngine
|
2
|
+
module ConfigurablesController
|
3
|
+
def show
|
4
|
+
|
5
|
+
end
|
6
|
+
|
7
|
+
def update
|
8
|
+
Configurable.keys.each do |key|
|
9
|
+
Configurable.find_or_create_by_name(key).
|
10
|
+
update_attribute(:value,params[key])
|
11
|
+
end
|
12
|
+
redirect_to admin_configurable_path
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
data/lib/configurable_engine.rb
CHANGED
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: 0.1.
|
8
|
+
- 2
|
9
|
+
version: 0.1.2
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Paul Campbell
|
@@ -100,13 +100,14 @@ files:
|
|
100
100
|
- README.md
|
101
101
|
- Rakefile
|
102
102
|
- VERSION
|
103
|
-
- app/controllers/admin/application_controller.rb
|
104
103
|
- app/controllers/admin/configurables_controller.rb
|
105
104
|
- app/models/configurable.rb
|
106
105
|
- app/views/admin/configurables/show.html.erb
|
107
106
|
- config/routes.rb
|
108
107
|
- configurable_engine.gemspec
|
109
108
|
- lib/configurable_engine.rb
|
109
|
+
- lib/configurable_engine/configurables_controller.rb
|
110
|
+
- lib/configurable_engine/engine.rb
|
110
111
|
- lib/generators/configurable_engine/install_generator.rb
|
111
112
|
- lib/generators/configurable_engine/templates/configurable.yml
|
112
113
|
- lib/generators/configurable_engine/templates/migration.rb
|
@@ -124,7 +125,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
124
125
|
requirements:
|
125
126
|
- - ">="
|
126
127
|
- !ruby/object:Gem::Version
|
127
|
-
hash:
|
128
|
+
hash: 2410880943193149020
|
128
129
|
segments:
|
129
130
|
- 0
|
130
131
|
version: "0"
|