ruboss4ruby 1.0.2 → 1.0.3
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/Generators +5 -0
- data/Manifest.txt +39 -41
- data/Rakefile +2 -1
- data/lib/ruboss4ruby.rb +16 -12
- data/lib/ruboss4ruby/active_foo.rb +39 -3
- data/lib/ruboss4ruby/recipes.rb +62 -0
- data/lib/ruboss4ruby/ruboss_helper.rb +54 -0
- data/lib/ruboss4ruby/ruboss_test_helpers.rb +31 -0
- data/lib/ruboss4ruby/tasks.rb +0 -2
- data/lib/ruboss4ruby/version.rb +2 -2
- data/merb_generators/ruboss_config.rb +19 -19
- data/merb_generators/ruboss_controller.rb +3 -3
- data/merb_generators/ruboss_flex_app.rb +3 -3
- data/merb_generators/ruboss_resource_controller.rb +3 -3
- data/merb_generators/ruboss_scaffold.rb +47 -47
- data/rails_generators/ruboss_config/ruboss_config_generator.rb +2 -2
- data/rails_generators/ruboss_config/templates/index.html.erb +2 -2
- data/rails_generators/ruboss_config/templates/mainapp-config.xml +21 -0
- data/rails_generators/ruboss_config/templates/mainapp.mxml +4 -7
- data/rails_generators/ruboss_config/templates/project-textmate.erb +52 -0
- data/rails_generators/ruboss_controller/ruboss_controller_generator.rb +0 -2
- data/rails_generators/ruboss_scaffold/ruboss_scaffold_generator.rb +0 -2
- data/rails_generators/ruboss_scaffold/templates/component.mxml.erb +4 -3
- data/rails_generators/ruboss_yaml_scaffold/ruboss_yaml_scaffold_generator.rb +0 -1
- data/test/controllers/application.rb +15 -0
- data/test/controllers/locations_controller.rb +93 -0
- data/test/controllers/notes_controller.rb +96 -0
- data/test/controllers/projects_controller.rb +93 -0
- data/test/controllers/tasks_controller.rb +93 -0
- data/test/controllers/users_controller.rb +93 -0
- data/test/database.yml +4 -0
- data/test/fixtures/locations.yml +8 -0
- data/test/fixtures/notes.yml +17 -0
- data/test/fixtures/projects.yml +25 -0
- data/test/fixtures/tasks.yml +46 -0
- data/test/fixtures/users.yml +13 -0
- data/test/helpers/controllers.log +8 -0
- data/test/helpers/functional_test_helper.rb +32 -0
- data/test/helpers/models.log +170 -0
- data/test/helpers/test_helper.rb +25 -0
- data/test/helpers/unit_test_helper.rb +23 -0
- data/test/model.yml +35 -0
- data/test/models/location.rb +4 -0
- data/test/models/note.rb +3 -0
- data/test/models/project.rb +6 -0
- data/test/models/task.rb +20 -0
- data/test/models/user.rb +23 -0
- data/test/playing_around_in_a_console.txt +71 -0
- data/test/schema.rb +63 -0
- data/test/test.sqlite3 +0 -0
- data/test/test.swf +1 -0
- data/test/test_active_foo.rb +79 -0
- data/test/test_ruboss_rails_integration_functional.rb +27 -0
- data/test/test_swfobject_helper.rb +63 -0
- data/test/to_fxml_test.rb +79 -0
- data/test/views/notes/empty_params_action.html.erb +1 -0
- data/test/views/notes/index.html.erb +1 -0
- metadata +57 -52
- data/merb_generators/ruboss_config/USAGE +0 -18
- data/merb_generators/ruboss_config/ruboss_config_generator.rb +0 -135
- data/merb_generators/ruboss_config/templates/actionscript.properties +0 -16
- data/merb_generators/ruboss_config/templates/actionscriptair.properties +0 -16
- data/merb_generators/ruboss_config/templates/expressInstall.swf +0 -0
- data/merb_generators/ruboss_config/templates/flex.properties +0 -2
- data/merb_generators/ruboss_config/templates/html-template/AC_OETags.js +0 -276
- data/merb_generators/ruboss_config/templates/html-template/history/history.css +0 -6
- data/merb_generators/ruboss_config/templates/html-template/history/history.js +0 -645
- data/merb_generators/ruboss_config/templates/html-template/history/historyFrame.html +0 -29
- data/merb_generators/ruboss_config/templates/html-template/index.template.html +0 -121
- data/merb_generators/ruboss_config/templates/html-template/playerProductInstall.swf +0 -0
- data/merb_generators/ruboss_config/templates/index.html.erb +0 -18
- data/merb_generators/ruboss_config/templates/mainair-app.xml +0 -134
- data/merb_generators/ruboss_config/templates/mainapp.mxml +0 -34
- data/merb_generators/ruboss_config/templates/project.properties +0 -18
- data/merb_generators/ruboss_config/templates/projectair.properties +0 -24
- data/merb_generators/ruboss_config/templates/swfobject.js +0 -5
- data/merb_generators/ruboss_controller/USAGE +0 -11
- data/merb_generators/ruboss_controller/ruboss_controller_generator.rb +0 -32
- data/merb_generators/ruboss_resource_controller/USAGE +0 -5
- data/merb_generators/ruboss_resource_controller/ruboss_resource_controller_generator.rb +0 -70
- data/merb_generators/ruboss_resource_controller/templates/app/controllers/%controller_file_name%.rb +0 -55
- data/merb_generators/ruboss_resource_controller/templates/app/helpers/%controller_file_name%_helper.rb +0 -16
- data/merb_generators/ruboss_scaffold/USAGE +0 -5
- data/merb_generators/ruboss_scaffold/ruboss_scaffold_generator.rb +0 -127
- data/merb_generators/ruboss_yaml_scaffold/USAGE +0 -5
- data/merb_generators/ruboss_yaml_scaffold/ruboss_yaml_scaffold_generator.rb +0 -53
- data/merb_generators/templates/ruboss_scaffold/component.mxml.erb +0 -148
- data/merb_generators/templates/ruboss_scaffold/fixtures.yml.erb +0 -35
- data/merb_generators/templates/ruboss_scaffold/migration.rb.erb +0 -19
- data/merb_generators/templates/ruboss_scaffold/model.as.erb +0 -42
- data/merb_generators/templates/ruboss_scaffold/model.rb.erb +0 -11
- data/test/active_foo_test.rb +0 -16
- data/test/test_generator_helper.rb +0 -29
- data/test/test_helper.rb +0 -2
- data/test/test_ruboss_config_generator.rb +0 -45
- data/test/test_ruboss_controller_generator.rb +0 -45
- data/test/test_ruboss_on_ruby.rb +0 -11
- data/test/test_ruboss_scaffold_generator.rb +0 -45
- data/test/test_ruboss_yaml_scaffold_generator.rb +0 -46
|
@@ -41,9 +41,9 @@ module Merb::Generators
|
|
|
41
41
|
File.join(File.dirname(__FILE__), 'templates', 'ruboss_controller')
|
|
42
42
|
end
|
|
43
43
|
|
|
44
|
-
template :controller do
|
|
45
|
-
source
|
|
46
|
-
destination
|
|
44
|
+
template :controller do |t|
|
|
45
|
+
t.source = 'controller.as.erb'
|
|
46
|
+
t.destination = File.join('app', 'flex', base_folder, 'controllers', "#{command_controller_name}.as")
|
|
47
47
|
end
|
|
48
48
|
|
|
49
49
|
desc <<-DESC
|
|
@@ -59,9 +59,9 @@ module Merb::Generators
|
|
|
59
59
|
Generates main flex application file.
|
|
60
60
|
DESC
|
|
61
61
|
|
|
62
|
-
template :main_app do
|
|
63
|
-
source
|
|
64
|
-
destination
|
|
62
|
+
template :main_app do |t|
|
|
63
|
+
t.source = 'mainapp.mxml'
|
|
64
|
+
t.destination = File.join('app', 'flex', "#{project_name}.mxml")
|
|
65
65
|
end
|
|
66
66
|
end
|
|
67
67
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
Merb::Generators::ResourceControllerGenerator.template :ruboss_resource_controller do
|
|
2
|
-
source
|
|
3
|
-
destination
|
|
1
|
+
Merb::Generators::ResourceControllerGenerator.template :ruboss_resource_controller, :orm => :activerecord do |t|
|
|
2
|
+
t.source = File.dirname(__FILE__) / "templates/ruboss_resource_controller/controller.rb.erb"
|
|
3
|
+
t.destination = "app/controllers" / base_path / "#{file_name}.rb"
|
|
4
4
|
end
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
require 'ruboss4ruby/configuration'
|
|
2
2
|
require 'ruboss4ruby/generated_attribute'
|
|
3
3
|
|
|
4
|
+
#NOTE: this is currently (merb 0.9.9 broken and needs to be rethought anyway. This line of thinking was based
|
|
5
|
+
# on the kind of code generation you could do with rails, it's a different code generation paradigm with Merb anyway)
|
|
4
6
|
module Merb::Generators
|
|
5
7
|
class RubossScaffoldGenerator < NamespacedGenerator
|
|
6
8
|
include Ruboss::Configuration
|
|
@@ -12,35 +14,8 @@ module Merb::Generators
|
|
|
12
14
|
second_argument :properties, :as => :hash, :required => true, :default => {}, :desc => "space separated model properties in form of name:type. Example: state:string"
|
|
13
15
|
|
|
14
16
|
def initialize(*args)
|
|
15
|
-
super
|
|
16
17
|
@project_name, @flex_project_name, @command_controller_name, @base_package, @base_folder = extract_names
|
|
17
|
-
|
|
18
|
-
@belongs_tos = []
|
|
19
|
-
@has_ones = []
|
|
20
|
-
@has_manies = []
|
|
21
|
-
# Figure out has_one, has_many and belongs_to based on args
|
|
22
|
-
self.properties.each do |key,value|
|
|
23
|
-
puts key + value
|
|
24
|
-
key = key.to_sym
|
|
25
|
-
if key == :has_one
|
|
26
|
-
# arg = "has_one:arg1,arg2", so all the has_one are together
|
|
27
|
-
@has_ones = value.split(',')
|
|
28
|
-
elsif key == :has_many
|
|
29
|
-
# arg = "has_many:arg1,arg2", so all the has_many are together
|
|
30
|
-
@has_manies = value.split(",")
|
|
31
|
-
elsif key == :belongs_to # belongs_to:arg1,arg2
|
|
32
|
-
@belongs_tos = value.split(',')
|
|
33
|
-
end
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
puts belongs_tos
|
|
37
|
-
puts has_manies
|
|
38
|
-
|
|
39
|
-
# Remove the has_one and has_many arguments since they are
|
|
40
|
-
# not for consumption by the scaffold generator, and since
|
|
41
|
-
# we have already used them to set the @belongs_tos, @has_ones and
|
|
42
|
-
# @has_manies.
|
|
43
|
-
self.properties.delete_if { |key, value| key =~ /^(has_one|has_many|belongs_to)/ }
|
|
18
|
+
super
|
|
44
19
|
end
|
|
45
20
|
|
|
46
21
|
def table_name
|
|
@@ -90,6 +65,35 @@ module Merb::Generators
|
|
|
90
65
|
end
|
|
91
66
|
|
|
92
67
|
def attributes
|
|
68
|
+
@belongs_tos = []
|
|
69
|
+
@has_ones = []
|
|
70
|
+
@has_manies = []
|
|
71
|
+
# Figure out has_one, has_many and belongs_to based on args
|
|
72
|
+
self.properties.each do |key,value|
|
|
73
|
+
puts key + value
|
|
74
|
+
key = key.to_sym
|
|
75
|
+
if key == :has_one
|
|
76
|
+
# arg = "has_one:arg1,arg2", so all the has_one are together
|
|
77
|
+
@has_ones = value.split(',')
|
|
78
|
+
elsif key == :has_many
|
|
79
|
+
# arg = "has_many:arg1,arg2", so all the has_many are together
|
|
80
|
+
@has_manies = value.split(",")
|
|
81
|
+
elsif key == :belongs_to # belongs_to:arg1,arg2
|
|
82
|
+
@belongs_tos = value.split(',')
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
puts "does this even run?"
|
|
87
|
+
|
|
88
|
+
puts belongs_tos
|
|
89
|
+
puts has_manies
|
|
90
|
+
|
|
91
|
+
# Remove the has_one and has_many arguments since they are
|
|
92
|
+
# not for consumption by the scaffold generator, and since
|
|
93
|
+
# we have already used them to set the @belongs_tos, @has_ones and
|
|
94
|
+
# @has_manies.
|
|
95
|
+
self.properties.delete_if { |key, value| key =~ /^(has_one|has_many|belongs_to)/ }
|
|
96
|
+
|
|
93
97
|
@attributes ||= self.properties.collect do |key, value|
|
|
94
98
|
Ruboss::Generator::GeneratedAttribute.new(key, value)
|
|
95
99
|
end
|
|
@@ -99,41 +103,37 @@ module Merb::Generators
|
|
|
99
103
|
File.join(File.dirname(__FILE__), 'templates', 'ruboss_scaffold')
|
|
100
104
|
end
|
|
101
105
|
|
|
102
|
-
# invoke :model do |generator|
|
|
103
|
-
# generator.new(destination_root, options, model_name, self.properties)
|
|
104
|
-
# end
|
|
105
|
-
|
|
106
106
|
invoke :ruboss_resource_controller do |generator|
|
|
107
107
|
generator.new(destination_root, options, controller_name)
|
|
108
108
|
end
|
|
109
109
|
|
|
110
|
-
template :ar_model, :flex_only => false do
|
|
111
|
-
source
|
|
112
|
-
destination
|
|
110
|
+
template :ar_model, :flex_only => false do |t|
|
|
111
|
+
t.source = 'model.rb.erb'
|
|
112
|
+
t.destination = File.join('app', 'models', "#{file_name}.rb")
|
|
113
113
|
end
|
|
114
114
|
|
|
115
115
|
empty_directory :fixtures, File.join('spec', 'fixtures')
|
|
116
116
|
|
|
117
|
-
template :fixture, :flex_only => false do
|
|
118
|
-
source
|
|
119
|
-
destination
|
|
117
|
+
template :fixture, :flex_only => false do |t|
|
|
118
|
+
t.source = 'fixtures.yml.erb'
|
|
119
|
+
t.destination = File.join('spec', 'fixtures', "#{table_name}.yml")
|
|
120
120
|
end
|
|
121
121
|
|
|
122
122
|
empty_directory :migrations, File.join('schema', 'migrations')
|
|
123
123
|
|
|
124
|
-
template :migration, :flex_only => false, :skip_migration => false do
|
|
125
|
-
source
|
|
126
|
-
destination
|
|
124
|
+
template :migration, :flex_only => false, :skip_migration => false do |t|
|
|
125
|
+
t.source = 'migration.rb.erb'
|
|
126
|
+
t.destination = File.join('schema', 'migrations', "#{migration_file_name}.rb")
|
|
127
127
|
end
|
|
128
128
|
|
|
129
|
-
template :as_model do
|
|
130
|
-
source
|
|
131
|
-
destination
|
|
129
|
+
template :as_model do |t|
|
|
130
|
+
t.source = 'model.as.erb'
|
|
131
|
+
t.destination = File.join('app', 'flex', base_folder, 'models', "#{class_name}.as")
|
|
132
132
|
end
|
|
133
133
|
|
|
134
|
-
template :flex_component do
|
|
135
|
-
source
|
|
136
|
-
destination
|
|
134
|
+
template :flex_component do |t|
|
|
135
|
+
t.source = 'component.mxml.erb'
|
|
136
|
+
t.destination = File.join('app', 'flex', base_folder, 'components', 'generated', "#{class_name}Box.mxml")
|
|
137
137
|
end
|
|
138
138
|
|
|
139
139
|
invoke :ruboss_controller do |generator|
|
|
@@ -12,8 +12,6 @@
|
|
|
12
12
|
# commercial license, please go to http://ruboss.com.
|
|
13
13
|
################################################################################
|
|
14
14
|
require 'open-uri'
|
|
15
|
-
require 'ruboss4ruby/version'
|
|
16
|
-
require 'ruboss4ruby/configuration'
|
|
17
15
|
|
|
18
16
|
class RubossConfigGenerator < Rails::Generator::Base
|
|
19
17
|
include Ruboss::Configuration
|
|
@@ -104,7 +102,9 @@ class RubossConfigGenerator < Rails::Generator::Base
|
|
|
104
102
|
|
|
105
103
|
m.dependency 'ruboss_controller', @args
|
|
106
104
|
end
|
|
105
|
+
m.template 'project-textmate.erb', "#{project_name.underscore}.tmproj"
|
|
107
106
|
m.template 'mainapp.mxml', File.join('app/flex', "#{project_name}.mxml")
|
|
107
|
+
m.template 'mainapp-config.xml', File.join('app/flex', "#{project_name}-config.xml")
|
|
108
108
|
m.template 'mainair-app.xml', File.join('app/flex', "#{project_name}-app.xml") if @use_air
|
|
109
109
|
end
|
|
110
110
|
end
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
<head>
|
|
3
3
|
<title><%= project_name %></title>
|
|
4
4
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
5
|
-
<script type="text/javascript" src="
|
|
5
|
+
<script type="text/javascript" src="javascripts/swfobject.js"></script>
|
|
6
6
|
<script type="text/javascript">
|
|
7
|
-
swfobject.embedSWF("
|
|
7
|
+
swfobject.embedSWF("bin/<%= project_name %>.swf", "mainApp", "100%", "100%", "9.0.0", "expressInstall.swf");
|
|
8
8
|
</script>
|
|
9
9
|
<style>
|
|
10
10
|
body { margin: 0px; overflow: hidden; }
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<flex-config>
|
|
2
|
+
<benchmark>false</benchmark>
|
|
3
|
+
<default-background-color>#FFFFFF</default-background-color>
|
|
4
|
+
<compiler>
|
|
5
|
+
<incremental>true</incremental>
|
|
6
|
+
<keep-as3-metadata append="true">
|
|
7
|
+
<name>Resource</name>
|
|
8
|
+
<name>HasOne</name>
|
|
9
|
+
<name>HasMany</name>
|
|
10
|
+
<name>BelongsTo</name>
|
|
11
|
+
<name>DateTime</name>
|
|
12
|
+
<name>Lazy</name>
|
|
13
|
+
<name>Ignored</name>
|
|
14
|
+
</keep-as3-metadata>
|
|
15
|
+
<optimize>true</optimize>
|
|
16
|
+
<keep-generated-actionscript>false</keep-generated-actionscript>
|
|
17
|
+
<warn-no-constructor>false</warn-no-constructor>
|
|
18
|
+
<warn-no-explicit-super-call-in-constructor>false</warn-no-explicit-super-call-in-constructor>
|
|
19
|
+
<debug>false</debug>
|
|
20
|
+
</compiler>
|
|
21
|
+
</flex-config>
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="utf-8"?>
|
|
2
2
|
<mx:<%= application_tag %> xmlns:mx="http://www.adobe.com/2006/mxml"
|
|
3
3
|
xmlns:generated="<%= base_package %>.components.generated.*"
|
|
4
|
-
|
|
5
|
-
styleName="plain"
|
|
6
|
-
initialize="init()">
|
|
4
|
+
paddingBottom="8" paddingLeft="8" paddingRight="8" paddingTop="8"
|
|
5
|
+
layout="horizontal" styleName="plain" initialize="init()">
|
|
7
6
|
<mx:Script>
|
|
8
7
|
<![CDATA[
|
|
9
8
|
<% if use_air -%>
|
|
10
9
|
import org.ruboss.services.air.AIRServiceProvider;
|
|
11
10
|
<% end -%>
|
|
12
|
-
|
|
11
|
+
import org.ruboss.Ruboss;
|
|
13
12
|
import <%= base_package %>.controllers.<%= command_controller_name %>;
|
|
14
13
|
|
|
15
14
|
private function init():void {
|
|
@@ -21,9 +20,7 @@
|
|
|
21
20
|
}
|
|
22
21
|
]]>
|
|
23
22
|
</mx:Script>
|
|
24
|
-
<mx:
|
|
25
|
-
<mx:LinkBar dataProvider="{mainViewStack}"/>
|
|
26
|
-
</mx:ApplicationControlBar>
|
|
23
|
+
<mx:LinkBar dataProvider="{mainViewStack}" direction="vertical" borderStyle="solid" backgroundColor="#EEEEEE"/>
|
|
27
24
|
<mx:ViewStack id="mainViewStack" width="100%" height="100%">
|
|
28
25
|
<!-- For a simple demo, put all the components here. -->
|
|
29
26
|
<% for component in component_names -%>
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
+
<plist version="1.0">
|
|
4
|
+
<dict>
|
|
5
|
+
<key>currentDocument</key>
|
|
6
|
+
<string>app/flex/<%= project_name %>.mxml</string>
|
|
7
|
+
<key>documents</key>
|
|
8
|
+
<array>
|
|
9
|
+
<dict>
|
|
10
|
+
<key>expanded</key>
|
|
11
|
+
<true/>
|
|
12
|
+
<key>name</key>
|
|
13
|
+
<string><%= project_name.underscore %></string>
|
|
14
|
+
<key>regexFolderFilter</key>
|
|
15
|
+
<string>!.*/(\.[^/]*|CVS|_darcs|_MTN|\{arch\}|blib|.*~\.nib|.*\.(framework|app|pbproj|pbxproj|xcode(proj)?|bundle))$</string>
|
|
16
|
+
<key>sourceDirectory</key>
|
|
17
|
+
<string></string>
|
|
18
|
+
</dict>
|
|
19
|
+
</array>
|
|
20
|
+
<key>fileHierarchyDrawerWidth</key>
|
|
21
|
+
<integer>299</integer>
|
|
22
|
+
<key>metaData</key>
|
|
23
|
+
<dict/>
|
|
24
|
+
<key>openDocuments</key>
|
|
25
|
+
<array>
|
|
26
|
+
<string>app/flex/<%= project_name %>.mxml</string>
|
|
27
|
+
</array>
|
|
28
|
+
<key>shellVariables</key>
|
|
29
|
+
<array>
|
|
30
|
+
<dict>
|
|
31
|
+
<key>enabled</key>
|
|
32
|
+
<true/>
|
|
33
|
+
<key>value</key>
|
|
34
|
+
<string>app/flex/<%= project_name %>.mxml</string>
|
|
35
|
+
<key>variable</key>
|
|
36
|
+
<string>TM_FLEX_FILE_SPECS</string>
|
|
37
|
+
</dict>
|
|
38
|
+
<dict>
|
|
39
|
+
<key>enabled</key>
|
|
40
|
+
<true/>
|
|
41
|
+
<key>value</key>
|
|
42
|
+
<string>public/bin/<%= project_name %>.swf</string>
|
|
43
|
+
<key>variable</key>
|
|
44
|
+
<string>TM_FLEX_OUTPUT</string>
|
|
45
|
+
</dict>
|
|
46
|
+
</array>
|
|
47
|
+
<key>showFileHierarchyDrawer</key>
|
|
48
|
+
<false/>
|
|
49
|
+
<key>windowFrame</key>
|
|
50
|
+
<string>{{5, 15}, {1073, 860}}</string>
|
|
51
|
+
</dict>
|
|
52
|
+
</plist>
|
|
@@ -11,8 +11,6 @@
|
|
|
11
11
|
# RCL v1 applies; otherwise, only the GPL v3 applies. To learn more or to buy a
|
|
12
12
|
# commercial license, please go to http://ruboss.com.
|
|
13
13
|
################################################################################
|
|
14
|
-
require 'ruboss4ruby/configuration'
|
|
15
|
-
|
|
16
14
|
class RubossControllerGenerator < Rails::Generator::Base
|
|
17
15
|
include Ruboss::Configuration
|
|
18
16
|
|
|
@@ -11,8 +11,6 @@
|
|
|
11
11
|
# RCL v1 applies; otherwise, only the GPL v3 applies. To learn more or to buy a
|
|
12
12
|
# commercial license, please go to http://ruboss.com.
|
|
13
13
|
################################################################################
|
|
14
|
-
require 'ruboss4ruby/configuration'
|
|
15
|
-
|
|
16
14
|
module Rails
|
|
17
15
|
module Generator
|
|
18
16
|
class GeneratedAttribute
|
|
@@ -98,8 +98,8 @@
|
|
|
98
98
|
}
|
|
99
99
|
]]></mx:Script>
|
|
100
100
|
<mx:Panel id="<%= class_name.downcase_first_letter.pluralize %>Panel"
|
|
101
|
-
title="<%= class_name.pluralize %>"
|
|
102
|
-
width="25%" height="100%">
|
|
101
|
+
title="<%= class_name.pluralize %>" cornerRadius="0" dropShadowEnabled="false" borderStyle="solid"
|
|
102
|
+
borderThickness="1" backgroundColor="#EEEEEE" width="25%" height="100%">
|
|
103
103
|
<mx:List id="<%= class_name.downcase_first_letter.pluralize %>List"
|
|
104
104
|
width="100%" height="100%"
|
|
105
105
|
dataProvider="{Ruboss.models.index(<%= class_name %>)}"
|
|
@@ -109,7 +109,8 @@
|
|
|
109
109
|
click="new<%= class_name %>()"/>
|
|
110
110
|
</mx:ControlBar>
|
|
111
111
|
</mx:Panel>
|
|
112
|
-
<mx:Panel title="Edit <%= class_name %>"
|
|
112
|
+
<mx:Panel title="Edit <%= class_name %>" cornerRadius="0" dropShadowEnabled="false" borderStyle="solid"
|
|
113
|
+
borderThickness="1" backgroundColor="#EEEEEE" width="75%" height="100%">
|
|
113
114
|
<mx:Form width="100%" height="100%">
|
|
114
115
|
<% for attribute in attributes -%>
|
|
115
116
|
<mx:FormItem label="<%= attribute.flex_name.capitalize_without_downcasing %>" width="100%">
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Filters added to this controller apply to all controllers in the application.
|
|
2
|
+
# Likewise, all the methods added will be available for all controllers.
|
|
3
|
+
|
|
4
|
+
class ApplicationController < ActionController::Base
|
|
5
|
+
helper :all # include all helpers, all the time
|
|
6
|
+
|
|
7
|
+
# See ActionController::RequestForgeryProtection for details
|
|
8
|
+
# Uncomment the :secret if you're not using the cookie session store
|
|
9
|
+
protect_from_forgery # :secret => 'c83e3ff98f15718c4544ca8821f2b6d4'
|
|
10
|
+
|
|
11
|
+
# See ActionController::Base for details
|
|
12
|
+
# Uncomment this to filter the contents of submitted sensitive data parameters
|
|
13
|
+
# from your application log (in this case, all fields with names like "password").
|
|
14
|
+
# filter_parameter_logging :password
|
|
15
|
+
end
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
class LocationsController < ApplicationController
|
|
2
|
+
# GET /locations
|
|
3
|
+
# GET /locations.xml
|
|
4
|
+
def index
|
|
5
|
+
@locations = Location.find(:all)
|
|
6
|
+
|
|
7
|
+
respond_to do |format|
|
|
8
|
+
format.html # index.html.erb
|
|
9
|
+
format.xml { render :xml => @locations }
|
|
10
|
+
format.fxml { render :fxml => @locations }
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# GET /locations/1
|
|
15
|
+
# GET /locations/1.xml
|
|
16
|
+
def show
|
|
17
|
+
@location = Location.find(params[:id])
|
|
18
|
+
|
|
19
|
+
respond_to do |format|
|
|
20
|
+
format.html # show.html.erb
|
|
21
|
+
format.xml { render :xml => @location }
|
|
22
|
+
format.fxml { render :fxml => @location }
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
# GET /locations/new
|
|
27
|
+
# GET /locations/new.xml
|
|
28
|
+
def new
|
|
29
|
+
@location = Location.new
|
|
30
|
+
|
|
31
|
+
respond_to do |format|
|
|
32
|
+
format.html # new.html.erb
|
|
33
|
+
format.xml { render :xml => @location }
|
|
34
|
+
format.fxml { render :fxml => @location }
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# GET /locations/1/edit
|
|
39
|
+
def edit
|
|
40
|
+
@location = Location.find(params[:id])
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# POST /locations
|
|
44
|
+
# POST /locations.xml
|
|
45
|
+
def create
|
|
46
|
+
@location = Location.new(params[:location])
|
|
47
|
+
|
|
48
|
+
respond_to do |format|
|
|
49
|
+
if @location.save
|
|
50
|
+
flash[:notice] = 'Location was successfully created.'
|
|
51
|
+
format.html { redirect_to(@location) }
|
|
52
|
+
format.xml { render :xml => @location, :status => :created, :location => @location }
|
|
53
|
+
format.fxml { render :fxml => @location }
|
|
54
|
+
else
|
|
55
|
+
format.html { render :action => "new" }
|
|
56
|
+
format.xml { render :xml => @location.errors, :status => :unprocessable_entity }
|
|
57
|
+
format.fxml { render :fxml => @location.errors }
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# PUT /locations/1
|
|
63
|
+
# PUT /locations/1.xml
|
|
64
|
+
def update
|
|
65
|
+
@location = Location.find(params[:id])
|
|
66
|
+
|
|
67
|
+
respond_to do |format|
|
|
68
|
+
if @location.update_attributes(params[:location])
|
|
69
|
+
flash[:notice] = 'Location was successfully updated.'
|
|
70
|
+
format.html { redirect_to(@location) }
|
|
71
|
+
format.xml { head :ok }
|
|
72
|
+
format.fxml { render :fxml => @location }
|
|
73
|
+
else
|
|
74
|
+
format.html { render :action => "edit" }
|
|
75
|
+
format.xml { render :xml => @location.errors, :status => :unprocessable_entity }
|
|
76
|
+
format.fxml { render :fxml => @location.errors }
|
|
77
|
+
end
|
|
78
|
+
end
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
# DELETE /locations/1
|
|
82
|
+
# DELETE /locations/1.xml
|
|
83
|
+
def destroy
|
|
84
|
+
@location = Location.find(params[:id])
|
|
85
|
+
@location.destroy
|
|
86
|
+
|
|
87
|
+
respond_to do |format|
|
|
88
|
+
format.html { redirect_to(locations_url) }
|
|
89
|
+
format.xml { head :ok }
|
|
90
|
+
format.fxml { render :fxml => @location }
|
|
91
|
+
end
|
|
92
|
+
end
|
|
93
|
+
end
|