ajax_scaffold_generator 3.1.8 → 3.1.9
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +4 -0
- data/ajax_scaffold_generator.rb +25 -25
- metadata +2 -2
data/CHANGELOG
CHANGED
data/ajax_scaffold_generator.rb
CHANGED
@@ -4,49 +4,49 @@ class AjaxScaffoldingSandbox < ScaffoldingSandbox
|
|
4
4
|
def default_input_block
|
5
5
|
Proc.new { |record, column| "<div class=\"form-element\">\n <label for=\"#{record}_#{column.name}\">#{column.human_name}</label>\n #{input(record, column.name)}\n</div>\n" }
|
6
6
|
end
|
7
|
-
|
8
|
-
def all_input_tags(record, record_name, options)
|
7
|
+
|
8
|
+
def all_input_tags(record, record_name, options)
|
9
9
|
input_block = options[:input_block] || default_input_block
|
10
|
-
|
10
|
+
|
11
11
|
if !options[:exclude].blank?
|
12
12
|
filtered_content_columns = record.class.content_columns.reject { |column| options[:exclude].include?(column.name) }
|
13
13
|
else
|
14
14
|
filtered_content_columns = record.class.content_columns
|
15
15
|
end
|
16
|
-
|
16
|
+
|
17
17
|
filtered_content_columns.collect{ |column| input_block.call(record_name, column) }.join("\n")
|
18
18
|
end
|
19
|
-
|
19
|
+
|
20
20
|
end
|
21
21
|
|
22
22
|
class ActionView::Helpers::InstanceTag
|
23
23
|
alias_method :base_to_input_field_tag, :to_input_field_tag
|
24
24
|
|
25
25
|
def to_input_field_tag(field_type, options={})
|
26
|
-
options[:class] = 'text-input'
|
26
|
+
options[:class] = 'text-input'
|
27
27
|
base_to_input_field_tag field_type, options
|
28
28
|
end
|
29
|
-
|
29
|
+
|
30
30
|
def to_boolean_select_tag(options = {})
|
31
31
|
options = options.stringify_keys
|
32
32
|
add_default_name_and_id(options)
|
33
33
|
tag_text = "<%= select \"#{@object_name}\", \"#{@method_name}\", [[\"True\", true], [\"False\", false]], { :selected => @#{@object_name}.#{@method_name} } %>"
|
34
34
|
end
|
35
|
-
|
35
|
+
|
36
36
|
end
|
37
37
|
|
38
38
|
class AjaxScaffoldGenerator < ScaffoldGenerator
|
39
39
|
|
40
40
|
alias_method :base_controller_file_path, :controller_file_path
|
41
|
-
|
41
|
+
|
42
42
|
def controller_file_path
|
43
43
|
"/" + base_controller_file_path
|
44
44
|
end
|
45
45
|
|
46
46
|
def manifest
|
47
|
-
|
47
|
+
|
48
48
|
record do |m|
|
49
|
-
|
49
|
+
|
50
50
|
# Check for class naming collisions.
|
51
51
|
m.class_collisions controller_class_path, "#{controller_class_name}Controller", "#{controller_class_name}ControllerTest", "#{controller_class_name}Helper"
|
52
52
|
m.class_collisions class_path, class_name, "#{singular_name}Test"
|
@@ -65,7 +65,7 @@ class AjaxScaffoldGenerator < ScaffoldGenerator
|
|
65
65
|
m.template 'model.rb', File.join('app/models', "#{singular_name}.rb")
|
66
66
|
m.template 'unit_test.rb', File.join('test/unit', "#{singular_name}_test.rb")
|
67
67
|
m.template 'fixtures.yml', File.join('test/fixtures', "#{table_name}.yml")
|
68
|
-
|
68
|
+
|
69
69
|
# Scaffolded forms.
|
70
70
|
m.complex_template 'form.rhtml',
|
71
71
|
File.join('app/views',
|
@@ -102,7 +102,7 @@ class AjaxScaffoldGenerator < ScaffoldGenerator
|
|
102
102
|
"#{action}.rhtml"),
|
103
103
|
:assigns => { :action => action }
|
104
104
|
end
|
105
|
-
|
105
|
+
|
106
106
|
# RJS templates
|
107
107
|
scaffold_rjs_templates.each do |template|
|
108
108
|
m.template "rjs_#{template}.rjs",
|
@@ -111,7 +111,7 @@ class AjaxScaffoldGenerator < ScaffoldGenerator
|
|
111
111
|
controller_file_name,
|
112
112
|
"#{template}.rjs")
|
113
113
|
end
|
114
|
-
|
114
|
+
|
115
115
|
# Libraries
|
116
116
|
scaffold_lib.each do |filename|
|
117
117
|
m.template "lib_#{filename}.rb",
|
@@ -137,16 +137,16 @@ class AjaxScaffoldGenerator < ScaffoldGenerator
|
|
137
137
|
|
138
138
|
# Layout and stylesheet.
|
139
139
|
m.template 'layout.rhtml',
|
140
|
-
File.join('app/views/layouts',
|
141
|
-
controller_class_path,
|
140
|
+
File.join('app/views/layouts',
|
141
|
+
controller_class_path,
|
142
142
|
"#{controller_file_name}.rhtml")
|
143
|
-
|
143
|
+
|
144
144
|
m.template 'ajax_scaffold.css', "public/stylesheets/ajax_scaffold.css"
|
145
|
-
|
145
|
+
|
146
146
|
scaffold_javascripts.each do |javascript|
|
147
147
|
m.template javascript, "public/javascripts/#{javascript}"
|
148
148
|
end
|
149
|
-
|
149
|
+
|
150
150
|
scaffold_images.each do |image|
|
151
151
|
m.template image, "public/images/#{image}"
|
152
152
|
end
|
@@ -163,27 +163,27 @@ class AjaxScaffoldGenerator < ScaffoldGenerator
|
|
163
163
|
def scaffold_views
|
164
164
|
%w( list component )
|
165
165
|
end
|
166
|
-
|
166
|
+
|
167
167
|
def scaffold_rjs_templates
|
168
168
|
%w( create destroy edit new update cancel )
|
169
169
|
end
|
170
|
-
|
170
|
+
|
171
171
|
def scaffold_partials
|
172
172
|
%w( form_messages messages column_headings new_edit pagination_links )
|
173
173
|
end
|
174
|
-
|
174
|
+
|
175
175
|
def scaffold_lib
|
176
176
|
%w( ajax_scaffold )
|
177
177
|
end
|
178
178
|
|
179
179
|
def scaffold_images
|
180
|
-
%w( indicator.gif indicator-small.gif add.gif
|
180
|
+
%w( indicator.gif indicator-small.gif add.gif arrow_down.gif arrow_up.gif )
|
181
181
|
end
|
182
|
-
|
182
|
+
|
183
183
|
def scaffold_javascripts
|
184
184
|
%w( ajax_scaffold.js rico_corner.js )
|
185
185
|
end
|
186
|
-
|
186
|
+
|
187
187
|
def create_sandbox
|
188
188
|
sandbox = AjaxScaffoldingSandbox.new
|
189
189
|
sandbox.singular_name = singular_name
|
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.11
|
|
3
3
|
specification_version: 1
|
4
4
|
name: ajax_scaffold_generator
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 3.1.
|
7
|
-
date: 2006-09-
|
6
|
+
version: 3.1.9
|
7
|
+
date: 2006-09-18 00:00:00 -06:00
|
8
8
|
summary: Ajax scaffold generator is a rails generator for ajaxified scaffolds
|
9
9
|
require_paths:
|
10
10
|
- lib
|