dust-generators 0.1.3 → 0.1.4

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.
Files changed (106) hide show
  1. data/Gemfile +0 -1
  2. data/Gemfile.lock +0 -18
  3. data/Rakefile +1 -1
  4. data/lib/dust/version.rb +1 -1
  5. data/rails_generators/dust_albums/USAGE +8 -0
  6. data/rails_generators/dust_albums/dust_albums_generator.rb +127 -0
  7. data/rails_generators/dust_albums/templates/README +11 -0
  8. data/rails_generators/dust_albums/templates/app/controllers/albums_controller.rb +56 -0
  9. data/rails_generators/dust_albums/templates/app/controllers/photos_controller.rb +89 -0
  10. data/rails_generators/dust_albums/templates/app/controllers/view_albums_controller.rb +17 -0
  11. data/rails_generators/dust_albums/templates/app/helpers/albums_helper.rb +2 -0
  12. data/rails_generators/dust_albums/templates/app/helpers/photos_helper.rb +2 -0
  13. data/rails_generators/dust_albums/templates/app/helpers/view_albums_helper.rb +2 -0
  14. data/rails_generators/dust_albums/templates/app/models/album.rb +42 -0
  15. data/rails_generators/dust_albums/templates/app/models/photo.rb +18 -0
  16. data/rails_generators/dust_albums/templates/app/views/albums/_form.html.erb +52 -0
  17. data/rails_generators/dust_albums/templates/app/views/albums/_search.html.erb +6 -0
  18. data/rails_generators/dust_albums/templates/app/views/albums/_upload_script.html.erb +37 -0
  19. data/rails_generators/dust_albums/templates/app/views/albums/edit.html.erb +5 -0
  20. data/rails_generators/dust_albums/templates/app/views/albums/index.html.erb +61 -0
  21. data/rails_generators/dust_albums/templates/app/views/albums/manage.html.erb +65 -0
  22. data/rails_generators/dust_albums/templates/app/views/albums/new.html.erb +6 -0
  23. data/rails_generators/dust_albums/templates/app/views/albums/show.html.erb +51 -0
  24. data/rails_generators/dust_albums/templates/app/views/albums/show.js.erb +1 -0
  25. data/rails_generators/dust_albums/templates/app/views/photos/_form.html.erb +23 -0
  26. data/rails_generators/dust_albums/templates/app/views/photos/_photo.html.erb +25 -0
  27. data/rails_generators/dust_albums/templates/app/views/photos/_search.html.erb +6 -0
  28. data/rails_generators/dust_albums/templates/app/views/photos/array.js.erb +3 -0
  29. data/rails_generators/dust_albums/templates/app/views/photos/edit.html.erb +28 -0
  30. data/rails_generators/dust_albums/templates/app/views/photos/index.html.erb +85 -0
  31. data/rails_generators/dust_albums/templates/app/views/photos/new.html.erb +7 -0
  32. data/rails_generators/dust_albums/templates/app/views/photos/show.html.erb +26 -0
  33. data/rails_generators/dust_albums/templates/app/views/photos/show.js.erb +9 -0
  34. data/rails_generators/dust_albums/templates/app/views/view_albums/index.html.erb +27 -0
  35. data/rails_generators/dust_albums/templates/app/views/view_albums/show.html.erb +31 -0
  36. data/rails_generators/dust_albums/templates/images/browse.png +0 -0
  37. data/rails_generators/dust_albums/templates/images/cancel.png +0 -0
  38. data/rails_generators/dust_albums/templates/images/save_position.png +0 -0
  39. data/rails_generators/dust_albums/templates/images/upload.png +0 -0
  40. data/rails_generators/dust_albums/templates/initializers/flash_session_cookie_middleware.rb +17 -0
  41. data/rails_generators/dust_albums/templates/initializers/session_store_middleware.rb +1 -0
  42. data/rails_generators/dust_albums/templates/javascript/dragsort.js +288 -0
  43. data/rails_generators/dust_albums/templates/javascript/dust_album.js +19 -0
  44. data/rails_generators/dust_albums/templates/javascript/uploadify/jquery.uploadify.v2.1.0.js +258 -0
  45. data/rails_generators/dust_albums/templates/javascript/uploadify/swfobject.js +4 -0
  46. data/rails_generators/dust_albums/templates/javascript/uploadify/uploadify.swf +0 -0
  47. data/rails_generators/dust_albums/templates/migration/albums_migration.rb +38 -0
  48. data/rails_generators/dust_albums/templates/stylesheets/dust_album.css +16 -0
  49. data/rails_generators/dust_albums/templates/stylesheets/dust_album_app.css +15 -0
  50. data/rails_generators/dust_albums/templates/stylesheets/uploadify.css +84 -0
  51. data/rails_generators/dust_config/USAGE +23 -0
  52. data/rails_generators/dust_config/dust_config_generator.rb +32 -0
  53. data/rails_generators/dust_config/templates/config.yml +8 -0
  54. data/rails_generators/dust_config/templates/load_config.rb +2 -0
  55. data/rails_generators/dust_scaffold/USAGE +51 -0
  56. data/rails_generators/dust_scaffold/dust_scaffold_generator.rb +232 -0
  57. data/rails_generators/dust_scaffold/templates/actions/create.rb +9 -0
  58. data/rails_generators/dust_scaffold/templates/actions/destroy.rb +6 -0
  59. data/rails_generators/dust_scaffold/templates/actions/edit.rb +3 -0
  60. data/rails_generators/dust_scaffold/templates/actions/index.rb +3 -0
  61. data/rails_generators/dust_scaffold/templates/actions/new.rb +3 -0
  62. data/rails_generators/dust_scaffold/templates/actions/show.rb +3 -0
  63. data/rails_generators/dust_scaffold/templates/actions/update.rb +9 -0
  64. data/rails_generators/dust_scaffold/templates/controller.rb +3 -0
  65. data/rails_generators/dust_scaffold/templates/fixtures.yml +9 -0
  66. data/rails_generators/dust_scaffold/templates/helper.rb +2 -0
  67. data/rails_generators/dust_scaffold/templates/migration.rb +16 -0
  68. data/rails_generators/dust_scaffold/templates/model.rb +3 -0
  69. data/rails_generators/dust_scaffold/templates/tests/rspec/actions/create.rb +11 -0
  70. data/rails_generators/dust_scaffold/templates/tests/rspec/actions/destroy.rb +6 -0
  71. data/rails_generators/dust_scaffold/templates/tests/rspec/actions/edit.rb +4 -0
  72. data/rails_generators/dust_scaffold/templates/tests/rspec/actions/index.rb +4 -0
  73. data/rails_generators/dust_scaffold/templates/tests/rspec/actions/new.rb +4 -0
  74. data/rails_generators/dust_scaffold/templates/tests/rspec/actions/show.rb +4 -0
  75. data/rails_generators/dust_scaffold/templates/tests/rspec/actions/update.rb +11 -0
  76. data/rails_generators/dust_scaffold/templates/tests/rspec/controller.rb +8 -0
  77. data/rails_generators/dust_scaffold/templates/tests/rspec/model.rb +7 -0
  78. data/rails_generators/dust_scaffold/templates/tests/shoulda/actions/create.rb +13 -0
  79. data/rails_generators/dust_scaffold/templates/tests/shoulda/actions/destroy.rb +8 -0
  80. data/rails_generators/dust_scaffold/templates/tests/shoulda/actions/edit.rb +6 -0
  81. data/rails_generators/dust_scaffold/templates/tests/shoulda/actions/index.rb +6 -0
  82. data/rails_generators/dust_scaffold/templates/tests/shoulda/actions/new.rb +6 -0
  83. data/rails_generators/dust_scaffold/templates/tests/shoulda/actions/show.rb +6 -0
  84. data/rails_generators/dust_scaffold/templates/tests/shoulda/actions/update.rb +13 -0
  85. data/rails_generators/dust_scaffold/templates/tests/shoulda/controller.rb +5 -0
  86. data/rails_generators/dust_scaffold/templates/tests/shoulda/model.rb +7 -0
  87. data/rails_generators/dust_scaffold/templates/tests/testunit/actions/create.rb +11 -0
  88. data/rails_generators/dust_scaffold/templates/tests/testunit/actions/destroy.rb +6 -0
  89. data/rails_generators/dust_scaffold/templates/tests/testunit/actions/edit.rb +4 -0
  90. data/rails_generators/dust_scaffold/templates/tests/testunit/actions/index.rb +4 -0
  91. data/rails_generators/dust_scaffold/templates/tests/testunit/actions/new.rb +4 -0
  92. data/rails_generators/dust_scaffold/templates/tests/testunit/actions/show.rb +4 -0
  93. data/rails_generators/dust_scaffold/templates/tests/testunit/actions/update.rb +11 -0
  94. data/rails_generators/dust_scaffold/templates/tests/testunit/controller.rb +5 -0
  95. data/rails_generators/dust_scaffold/templates/tests/testunit/model.rb +7 -0
  96. data/rails_generators/dust_scaffold/templates/views/erb/_form.html.erb +10 -0
  97. data/rails_generators/dust_scaffold/templates/views/erb/edit.html.erb +14 -0
  98. data/rails_generators/dust_scaffold/templates/views/erb/index.html.erb +29 -0
  99. data/rails_generators/dust_scaffold/templates/views/erb/new.html.erb +7 -0
  100. data/rails_generators/dust_scaffold/templates/views/erb/show.html.erb +20 -0
  101. data/rails_generators/dust_scaffold/templates/views/haml/_form.html.haml +10 -0
  102. data/rails_generators/dust_scaffold/templates/views/haml/edit.html.haml +14 -0
  103. data/rails_generators/dust_scaffold/templates/views/haml/index.html.haml +25 -0
  104. data/rails_generators/dust_scaffold/templates/views/haml/new.html.haml +7 -0
  105. data/rails_generators/dust_scaffold/templates/views/haml/show.html.haml +20 -0
  106. metadata +127 -33
@@ -0,0 +1,19 @@
1
+ $(document).ready(function(){
2
+
3
+ // photo management /////////////////////////////////////////////////////////////////////////////////////////////
4
+ $("#uploads").dragsort();
5
+
6
+ $(function () { // this line makes sure this code runs on page load
7
+ $('.checkall').click(function () {
8
+ $(this).parents('form:eq(0)').find(':checkbox').attr('checked', this.checked);
9
+ });
10
+ });
11
+
12
+ $('#order_photos').click(function(){
13
+ mylist = $('#uploads').serializelist();
14
+ $.post("/photos/array", mylist);
15
+ $.fancybox.showActivity();
16
+ return false;
17
+ });
18
+
19
+ });
@@ -0,0 +1,258 @@
1
+ /*
2
+ Uploadify v2.1.0
3
+ Release Date: August 24, 2009
4
+
5
+ Copyright (c) 2009 Ronnie Garcia, Travis Nickels
6
+
7
+ Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ of this software and associated documentation files (the "Software"), to deal
9
+ in the Software without restriction, including without limitation the rights
10
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ copies of the Software, and to permit persons to whom the Software is
12
+ furnished to do so, subject to the following conditions:
13
+
14
+ The above copyright notice and this permission notice shall be included in
15
+ all copies or substantial portions of the Software.
16
+
17
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ THE SOFTWARE.
24
+ */
25
+
26
+ if(jQuery)(
27
+ function(jQuery){
28
+ jQuery.extend(jQuery.fn,{
29
+ uploadify:function(options) {
30
+ jQuery(this).each(function(){
31
+ settings = jQuery.extend({
32
+ id : jQuery(this).attr('id'), // The ID of the object being Uploadified
33
+ uploader : 'uploadify.swf', // The path to the uploadify swf file
34
+ script : 'uploadify.php', // The path to the uploadify backend upload script
35
+ expressInstall : null, // The path to the express install swf file
36
+ folder : '', // The path to the upload folder
37
+ height : 30, // The height of the flash button
38
+ width : 110, // The width of the flash button
39
+ cancelImg : 'cancel.png', // The path to the cancel image for the default file queue item container
40
+ wmode : 'opaque', // The wmode of the flash file
41
+ scriptAccess : 'sameDomain', // Set to "always" to allow script access across domains
42
+ fileDataName : 'Filedata', // The name of the file collection object in the backend upload script
43
+ method : 'POST', // The method for sending variables to the backend upload script
44
+ queueSizeLimit : 999, // The maximum size of the file queue
45
+ simUploadLimit : 1, // The number of simultaneous uploads allowed
46
+ queueID : false, // The optional ID of the queue container
47
+ displayData : 'percentage', // Set to "speed" to show the upload speed in the default queue item
48
+ onInit : function() {}, // Function to run when uploadify is initialized
49
+ onSelect : function() {}, // Function to run when a file is selected
50
+ onQueueFull : function() {}, // Function to run when the queue reaches capacity
51
+ onCheck : function() {}, // Function to run when script checks for duplicate files on the server
52
+ onCancel : function() {}, // Function to run when an item is cleared from the queue
53
+ onError : function() {}, // Function to run when an upload item returns an error
54
+ onProgress : function() {}, // Function to run each time the upload progress is updated
55
+ onComplete : function() {}, // Function to run when an upload is completed
56
+ onAllComplete : function() {} // Functino to run when all uploads are completed
57
+ }, options);
58
+ var pagePath = location.pathname;
59
+ pagePath = pagePath.split('/');
60
+ pagePath.pop();
61
+ pagePath = pagePath.join('/') + '/';
62
+ var data = {};
63
+ data.uploadifyID = settings.id;
64
+ data.pagepath = pagePath;
65
+ if (settings.buttonImg) data.buttonImg = escape(settings.buttonImg);
66
+ if (settings.buttonText) data.buttonText = escape(settings.buttonText);
67
+ if (settings.rollover) data.rollover = true;
68
+ data.script = settings.script;
69
+ data.folder = escape(settings.folder);
70
+ if (settings.scriptData) {
71
+ var scriptDataString = '';
72
+ for (var name in settings.scriptData) {
73
+ scriptDataString += '&' + name + '=' + settings.scriptData[name];
74
+ }
75
+ data.scriptData = escape(scriptDataString.substr(1));
76
+ }
77
+ data.width = settings.width;
78
+ data.height = settings.height;
79
+ data.wmode = settings.wmode;
80
+ data.method = settings.method;
81
+ data.queueSizeLimit = settings.queueSizeLimit;
82
+ data.simUploadLimit = settings.simUploadLimit;
83
+ if (settings.hideButton) data.hideButton = true;
84
+ if (settings.fileDesc) data.fileDesc = settings.fileDesc;
85
+ if (settings.fileExt) data.fileExt = settings.fileExt;
86
+ if (settings.multi) data.multi = true;
87
+ if (settings.auto) data.auto = true;
88
+ if (settings.sizeLimit) data.sizeLimit = settings.sizeLimit;
89
+ if (settings.checkScript) data.checkScript = settings.checkScript;
90
+ if (settings.fileDataName) data.fileDataName = settings.fileDataName;
91
+ if (settings.queueID) data.queueID = settings.queueID;
92
+ if (settings.onInit() !== false) {
93
+ jQuery(this).css('display','none');
94
+ jQuery(this).after('<div id="' + jQuery(this).attr('id') + 'Uploader"></div>');
95
+ swfobject.embedSWF(settings.uploader, settings.id + 'Uploader', settings.width, settings.height, '9.0.24', settings.expressInstall, data, {'quality':'high','wmode':settings.wmode,'allowScriptAccess':settings.scriptAccess});
96
+ if (settings.queueID == false) {
97
+ jQuery("#" + jQuery(this).attr('id') + "Uploader").after('<div id="' + jQuery(this).attr('id') + 'Queue" class="uploadifyQueue"></div>');
98
+ }
99
+ }
100
+ if (typeof(settings.onOpen) == 'function') {
101
+ jQuery(this).bind("uploadifyOpen", settings.onOpen);
102
+ }
103
+ jQuery(this).bind("uploadifySelect", {'action': settings.onSelect, 'queueID': settings.queueID}, function(event, ID, fileObj) {
104
+ if (event.data.action(event, ID, fileObj) !== false) {
105
+ var byteSize = Math.round(fileObj.size / 1024 * 100) * .01;
106
+ var suffix = 'KB';
107
+ if (byteSize > 1000) {
108
+ byteSize = Math.round(byteSize *.001 * 100) * .01;
109
+ suffix = 'MB';
110
+ }
111
+ var sizeParts = byteSize.toString().split('.');
112
+ if (sizeParts.length > 1) {
113
+ byteSize = sizeParts[0] + '.' + sizeParts[1].substr(0,2);
114
+ } else {
115
+ byteSize = sizeParts[0];
116
+ }
117
+ if (fileObj.name.length > 20) {
118
+ fileName = fileObj.name.substr(0,20) + '...';
119
+ } else {
120
+ fileName = fileObj.name;
121
+ }
122
+ queue = '#' + jQuery(this).attr('id') + 'Queue';
123
+ if (event.data.queueID) {
124
+ queue = '#' + event.data.queueID;
125
+ }
126
+ jQuery(queue).append('<div id="' + jQuery(this).attr('id') + ID + '" class="uploadifyQueueItem">\
127
+ <div class="cancel">\
128
+ <a href="javascript:jQuery(\'#' + jQuery(this).attr('id') + '\').uploadifyCancel(\'' + ID + '\')"><img src="' + settings.cancelImg + '" border="0" /></a>\
129
+ </div>\
130
+ <span class="fileName">' + fileName + ' (' + byteSize + suffix + ')</span><span class="percentage"></span>\
131
+ <div class="uploadifyProgress">\
132
+ <div id="' + jQuery(this).attr('id') + ID + 'ProgressBar" class="uploadifyProgressBar"><!--Progress Bar--></div>\
133
+ </div>\
134
+ </div>');
135
+ }
136
+ });
137
+ if (typeof(settings.onSelectOnce) == 'function') {
138
+ jQuery(this).bind("uploadifySelectOnce", settings.onSelectOnce);
139
+ }
140
+ jQuery(this).bind("uploadifyQueueFull", {'action': settings.onQueueFull}, function(event, queueSizeLimit) {
141
+ if (event.data.action(event, queueSizeLimit) !== false) {
142
+ alert('The queue is full. The max size is ' + queueSizeLimit + '.');
143
+ }
144
+ });
145
+ jQuery(this).bind("uploadifyCheckExist", {'action': settings.onCheck}, function(event, checkScript, fileQueueObj, folder, single) {
146
+ var postData = new Object();
147
+ postData = fileQueueObj;
148
+ postData.folder = pagePath + folder;
149
+ if (single) {
150
+ for (var ID in fileQueueObj) {
151
+ var singleFileID = ID;
152
+ }
153
+ }
154
+ jQuery.post(checkScript, postData, function(data) {
155
+ for(var key in data) {
156
+ if (event.data.action(event, checkScript, fileQueueObj, folder, single) !== false) {
157
+ var replaceFile = confirm("Do you want to replace the file " + data[key] + "?");
158
+ if (!replaceFile) {
159
+ document.getElementById(jQuery(event.target).attr('id') + 'Uploader').cancelFileUpload(key, true,true);
160
+ }
161
+ }
162
+ }
163
+ if (single) {
164
+ document.getElementById(jQuery(event.target).attr('id') + 'Uploader').startFileUpload(singleFileID, true);
165
+ } else {
166
+ document.getElementById(jQuery(event.target).attr('id') + 'Uploader').startFileUpload(null, true);
167
+ }
168
+ }, "json");
169
+ });
170
+ jQuery(this).bind("uploadifyCancel", {'action': settings.onCancel}, function(event, ID, fileObj, data, clearFast) {
171
+ if (event.data.action(event, ID, fileObj, data, clearFast) !== false) {
172
+ var fadeSpeed = (clearFast == true) ? 0 : 250;
173
+ jQuery("#" + jQuery(this).attr('id') + ID).fadeOut(fadeSpeed, function() { jQuery(this).remove() });
174
+ }
175
+ });
176
+ if (typeof(settings.onClearQueue) == 'function') {
177
+ jQuery(this).bind("uploadifyClearQueue", settings.onClearQueue);
178
+ }
179
+ var errorArray = [];
180
+ jQuery(this).bind("uploadifyError", {'action': settings.onError}, function(event, ID, fileObj, errorObj) {
181
+ if (event.data.action(event, ID, fileObj, errorObj) !== false) {
182
+ var fileArray = new Array(ID, fileObj, errorObj);
183
+ errorArray.push(fileArray);
184
+ jQuery("#" + jQuery(this).attr('id') + ID + " .percentage").text(" - " + errorObj.type + " Error");
185
+ jQuery("#" + jQuery(this).attr('id') + ID).addClass('uploadifyError');
186
+ }
187
+ });
188
+ jQuery(this).bind("uploadifyProgress", {'action': settings.onProgress, 'toDisplay': settings.displayData}, function(event, ID, fileObj, data) {
189
+ if (event.data.action(event, ID, fileObj, data) !== false) {
190
+ jQuery("#" + jQuery(this).attr('id') + ID + "ProgressBar").css('width', data.percentage + '%');
191
+ if (event.data.toDisplay == 'percentage') displayData = ' - ' + data.percentage + '%';
192
+ if (event.data.toDisplay == 'speed') displayData = ' - ' + data.speed + 'KB/s';
193
+ if (event.data.toDisplay == null) displayData = ' ';
194
+ jQuery("#" + jQuery(this).attr('id') + ID + " .percentage").text(displayData);
195
+ }
196
+ });
197
+ jQuery(this).bind("uploadifyComplete", {'action': settings.onComplete}, function(event, ID, fileObj, response, data) {
198
+ if (event.data.action(event, ID, fileObj, unescape(response), data) !== false) {
199
+ jQuery("#" + jQuery(this).attr('id') + ID + " .percentage").text(' - Completed');
200
+ jQuery("#" + jQuery(this).attr('id') + ID).fadeOut(250, function() { jQuery(this).remove()});
201
+ }
202
+ });
203
+ if (typeof(settings.onAllComplete) == 'function') {
204
+ jQuery(this).bind("uploadifyAllComplete", {'action': settings.onAllComplete}, function(event, uploadObj) {
205
+ if (event.data.action(event, uploadObj) !== false) {
206
+ errorArray = [];
207
+ }
208
+ });
209
+ }
210
+ });
211
+ },
212
+ uploadifySettings:function(settingName, settingValue, resetObject) {
213
+ var returnValue = false;
214
+ jQuery(this).each(function() {
215
+ if (settingName == 'scriptData' && settingValue != null) {
216
+ if (resetObject) {
217
+ var scriptData = settingValue;
218
+ } else {
219
+ var scriptData = jQuery.extend(settings.scriptData, settingValue);
220
+ }
221
+ var scriptDataString = '';
222
+ for (var name in scriptData) {
223
+ scriptDataString += '&' + name + '=' + escape(scriptData[name]);
224
+ }
225
+ settingValue = scriptDataString.substr(1);
226
+ }
227
+ returnValue = document.getElementById(jQuery(this).attr('id') + 'Uploader').updateSettings(settingName, settingValue);
228
+ });
229
+ if (settingValue == null) {
230
+ if (settingName == 'scriptData') {
231
+ var returnSplit = unescape(returnValue).split('&');
232
+ var returnObj = new Object();
233
+ for (var i = 0; i < returnSplit.length; i++) {
234
+ var iSplit = returnSplit[i].split('=');
235
+ returnObj[iSplit[0]] = iSplit[1];
236
+ }
237
+ returnValue = returnObj;
238
+ }
239
+ return returnValue;
240
+ }
241
+ },
242
+ uploadifyUpload:function(ID) {
243
+ jQuery(this).each(function() {
244
+ document.getElementById(jQuery(this).attr('id') + 'Uploader').startFileUpload(ID, false);
245
+ });
246
+ },
247
+ uploadifyCancel:function(ID) {
248
+ jQuery(this).each(function() {
249
+ document.getElementById(jQuery(this).attr('id') + 'Uploader').cancelFileUpload(ID, true, false);
250
+ });
251
+ },
252
+ uploadifyClearQueue:function() {
253
+ jQuery(this).each(function() {
254
+ document.getElementById(jQuery(this).attr('id') + 'Uploader').clearFileUploadQueue(false);
255
+ });
256
+ }
257
+ })
258
+ })(jQuery);
@@ -0,0 +1,4 @@
1
+ /* SWFObject v2.2 <http://code.google.com/p/swfobject/>
2
+ is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
3
+ */
4
+ var swfobject=function(){var D="undefined",r="object",S="Shockwave Flash",W="ShockwaveFlash.ShockwaveFlash",q="application/x-shockwave-flash",R="SWFObjectExprInst",x="onreadystatechange",O=window,j=document,t=navigator,T=false,U=[h],o=[],N=[],I=[],l,Q,E,B,J=false,a=false,n,G,m=true,M=function(){var aa=typeof j.getElementById!=D&&typeof j.getElementsByTagName!=D&&typeof j.createElement!=D,ah=t.userAgent.toLowerCase(),Y=t.platform.toLowerCase(),ae=Y?/win/.test(Y):/win/.test(ah),ac=Y?/mac/.test(Y):/mac/.test(ah),af=/webkit/.test(ah)?parseFloat(ah.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,X=!+"\v1",ag=[0,0,0],ab=null;if(typeof t.plugins!=D&&typeof t.plugins[S]==r){ab=t.plugins[S].description;if(ab&&!(typeof t.mimeTypes!=D&&t.mimeTypes[q]&&!t.mimeTypes[q].enabledPlugin)){T=true;X=false;ab=ab.replace(/^.*\s+(\S+\s+\S+$)/,"$1");ag[0]=parseInt(ab.replace(/^(.*)\..*$/,"$1"),10);ag[1]=parseInt(ab.replace(/^.*\.(.*)\s.*$/,"$1"),10);ag[2]=/[a-zA-Z]/.test(ab)?parseInt(ab.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof O.ActiveXObject!=D){try{var ad=new ActiveXObject(W);if(ad){ab=ad.GetVariable("$version");if(ab){X=true;ab=ab.split(" ")[1].split(",");ag=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}}catch(Z){}}}return{w3:aa,pv:ag,wk:af,ie:X,win:ae,mac:ac}}(),k=function(){if(!M.w3){return}if((typeof j.readyState!=D&&j.readyState=="complete")||(typeof j.readyState==D&&(j.getElementsByTagName("body")[0]||j.body))){f()}if(!J){if(typeof j.addEventListener!=D){j.addEventListener("DOMContentLoaded",f,false)}if(M.ie&&M.win){j.attachEvent(x,function(){if(j.readyState=="complete"){j.detachEvent(x,arguments.callee);f()}});if(O==top){(function(){if(J){return}try{j.documentElement.doScroll("left")}catch(X){setTimeout(arguments.callee,0);return}f()})()}}if(M.wk){(function(){if(J){return}if(!/loaded|complete/.test(j.readyState)){setTimeout(arguments.callee,0);return}f()})()}s(f)}}();function f(){if(J){return}try{var Z=j.getElementsByTagName("body")[0].appendChild(C("span"));Z.parentNode.removeChild(Z)}catch(aa){return}J=true;var X=U.length;for(var Y=0;Y<X;Y++){U[Y]()}}function K(X){if(J){X()}else{U[U.length]=X}}function s(Y){if(typeof O.addEventListener!=D){O.addEventListener("load",Y,false)}else{if(typeof j.addEventListener!=D){j.addEventListener("load",Y,false)}else{if(typeof O.attachEvent!=D){i(O,"onload",Y)}else{if(typeof O.onload=="function"){var X=O.onload;O.onload=function(){X();Y()}}else{O.onload=Y}}}}}function h(){if(T){V()}else{H()}}function V(){var X=j.getElementsByTagName("body")[0];var aa=C(r);aa.setAttribute("type",q);var Z=X.appendChild(aa);if(Z){var Y=0;(function(){if(typeof Z.GetVariable!=D){var ab=Z.GetVariable("$version");if(ab){ab=ab.split(" ")[1].split(",");M.pv=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}else{if(Y<10){Y++;setTimeout(arguments.callee,10);return}}X.removeChild(aa);Z=null;H()})()}else{H()}}function H(){var ag=o.length;if(ag>0){for(var af=0;af<ag;af++){var Y=o[af].id;var ab=o[af].callbackFn;var aa={success:false,id:Y};if(M.pv[0]>0){var ae=c(Y);if(ae){if(F(o[af].swfVersion)&&!(M.wk&&M.wk<312)){w(Y,true);if(ab){aa.success=true;aa.ref=z(Y);ab(aa)}}else{if(o[af].expressInstall&&A()){var ai={};ai.data=o[af].expressInstall;ai.width=ae.getAttribute("width")||"0";ai.height=ae.getAttribute("height")||"0";if(ae.getAttribute("class")){ai.styleclass=ae.getAttribute("class")}if(ae.getAttribute("align")){ai.align=ae.getAttribute("align")}var ah={};var X=ae.getElementsByTagName("param");var ac=X.length;for(var ad=0;ad<ac;ad++){if(X[ad].getAttribute("name").toLowerCase()!="movie"){ah[X[ad].getAttribute("name")]=X[ad].getAttribute("value")}}P(ai,ah,Y,ab)}else{p(ae);if(ab){ab(aa)}}}}}else{w(Y,true);if(ab){var Z=z(Y);if(Z&&typeof Z.SetVariable!=D){aa.success=true;aa.ref=Z}ab(aa)}}}}}function z(aa){var X=null;var Y=c(aa);if(Y&&Y.nodeName=="OBJECT"){if(typeof Y.SetVariable!=D){X=Y}else{var Z=Y.getElementsByTagName(r)[0];if(Z){X=Z}}}return X}function A(){return !a&&F("6.0.65")&&(M.win||M.mac)&&!(M.wk&&M.wk<312)}function P(aa,ab,X,Z){a=true;E=Z||null;B={success:false,id:X};var ae=c(X);if(ae){if(ae.nodeName=="OBJECT"){l=g(ae);Q=null}else{l=ae;Q=X}aa.id=R;if(typeof aa.width==D||(!/%$/.test(aa.width)&&parseInt(aa.width,10)<310)){aa.width="310"}if(typeof aa.height==D||(!/%$/.test(aa.height)&&parseInt(aa.height,10)<137)){aa.height="137"}j.title=j.title.slice(0,47)+" - Flash Player Installation";var ad=M.ie&&M.win?"ActiveX":"PlugIn",ac="MMredirectURL="+O.location.toString().replace(/&/g,"%26")+"&MMplayerType="+ad+"&MMdoctitle="+j.title;if(typeof ab.flashvars!=D){ab.flashvars+="&"+ac}else{ab.flashvars=ac}if(M.ie&&M.win&&ae.readyState!=4){var Y=C("div");X+="SWFObjectNew";Y.setAttribute("id",X);ae.parentNode.insertBefore(Y,ae);ae.style.display="none";(function(){if(ae.readyState==4){ae.parentNode.removeChild(ae)}else{setTimeout(arguments.callee,10)}})()}u(aa,ab,X)}}function p(Y){if(M.ie&&M.win&&Y.readyState!=4){var X=C("div");Y.parentNode.insertBefore(X,Y);X.parentNode.replaceChild(g(Y),X);Y.style.display="none";(function(){if(Y.readyState==4){Y.parentNode.removeChild(Y)}else{setTimeout(arguments.callee,10)}})()}else{Y.parentNode.replaceChild(g(Y),Y)}}function g(ab){var aa=C("div");if(M.win&&M.ie){aa.innerHTML=ab.innerHTML}else{var Y=ab.getElementsByTagName(r)[0];if(Y){var ad=Y.childNodes;if(ad){var X=ad.length;for(var Z=0;Z<X;Z++){if(!(ad[Z].nodeType==1&&ad[Z].nodeName=="PARAM")&&!(ad[Z].nodeType==8)){aa.appendChild(ad[Z].cloneNode(true))}}}}}return aa}function u(ai,ag,Y){var X,aa=c(Y);if(M.wk&&M.wk<312){return X}if(aa){if(typeof ai.id==D){ai.id=Y}if(M.ie&&M.win){var ah="";for(var ae in ai){if(ai[ae]!=Object.prototype[ae]){if(ae.toLowerCase()=="data"){ag.movie=ai[ae]}else{if(ae.toLowerCase()=="styleclass"){ah+=' class="'+ai[ae]+'"'}else{if(ae.toLowerCase()!="classid"){ah+=" "+ae+'="'+ai[ae]+'"'}}}}}var af="";for(var ad in ag){if(ag[ad]!=Object.prototype[ad]){af+='<param name="'+ad+'" value="'+ag[ad]+'" />'}}aa.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+ah+">"+af+"</object>";N[N.length]=ai.id;X=c(ai.id)}else{var Z=C(r);Z.setAttribute("type",q);for(var ac in ai){if(ai[ac]!=Object.prototype[ac]){if(ac.toLowerCase()=="styleclass"){Z.setAttribute("class",ai[ac])}else{if(ac.toLowerCase()!="classid"){Z.setAttribute(ac,ai[ac])}}}}for(var ab in ag){if(ag[ab]!=Object.prototype[ab]&&ab.toLowerCase()!="movie"){e(Z,ab,ag[ab])}}aa.parentNode.replaceChild(Z,aa);X=Z}}return X}function e(Z,X,Y){var aa=C("param");aa.setAttribute("name",X);aa.setAttribute("value",Y);Z.appendChild(aa)}function y(Y){var X=c(Y);if(X&&X.nodeName=="OBJECT"){if(M.ie&&M.win){X.style.display="none";(function(){if(X.readyState==4){b(Y)}else{setTimeout(arguments.callee,10)}})()}else{X.parentNode.removeChild(X)}}}function b(Z){var Y=c(Z);if(Y){for(var X in Y){if(typeof Y[X]=="function"){Y[X]=null}}Y.parentNode.removeChild(Y)}}function c(Z){var X=null;try{X=j.getElementById(Z)}catch(Y){}return X}function C(X){return j.createElement(X)}function i(Z,X,Y){Z.attachEvent(X,Y);I[I.length]=[Z,X,Y]}function F(Z){var Y=M.pv,X=Z.split(".");X[0]=parseInt(X[0],10);X[1]=parseInt(X[1],10)||0;X[2]=parseInt(X[2],10)||0;return(Y[0]>X[0]||(Y[0]==X[0]&&Y[1]>X[1])||(Y[0]==X[0]&&Y[1]==X[1]&&Y[2]>=X[2]))?true:false}function v(ac,Y,ad,ab){if(M.ie&&M.mac){return}var aa=j.getElementsByTagName("head")[0];if(!aa){return}var X=(ad&&typeof ad=="string")?ad:"screen";if(ab){n=null;G=null}if(!n||G!=X){var Z=C("style");Z.setAttribute("type","text/css");Z.setAttribute("media",X);n=aa.appendChild(Z);if(M.ie&&M.win&&typeof j.styleSheets!=D&&j.styleSheets.length>0){n=j.styleSheets[j.styleSheets.length-1]}G=X}if(M.ie&&M.win){if(n&&typeof n.addRule==r){n.addRule(ac,Y)}}else{if(n&&typeof j.createTextNode!=D){n.appendChild(j.createTextNode(ac+" {"+Y+"}"))}}}function w(Z,X){if(!m){return}var Y=X?"visible":"hidden";if(J&&c(Z)){c(Z).style.visibility=Y}else{v("#"+Z,"visibility:"+Y)}}function L(Y){var Z=/[\\\"<>\.;]/;var X=Z.exec(Y)!=null;return X&&typeof encodeURIComponent!=D?encodeURIComponent(Y):Y}var d=function(){if(M.ie&&M.win){window.attachEvent("onunload",function(){var ac=I.length;for(var ab=0;ab<ac;ab++){I[ab][0].detachEvent(I[ab][1],I[ab][2])}var Z=N.length;for(var aa=0;aa<Z;aa++){y(N[aa])}for(var Y in M){M[Y]=null}M=null;for(var X in swfobject){swfobject[X]=null}swfobject=null})}}();return{registerObject:function(ab,X,aa,Z){if(M.w3&&ab&&X){var Y={};Y.id=ab;Y.swfVersion=X;Y.expressInstall=aa;Y.callbackFn=Z;o[o.length]=Y;w(ab,false)}else{if(Z){Z({success:false,id:ab})}}},getObjectById:function(X){if(M.w3){return z(X)}},embedSWF:function(ab,ah,ae,ag,Y,aa,Z,ad,af,ac){var X={success:false,id:ah};if(M.w3&&!(M.wk&&M.wk<312)&&ab&&ah&&ae&&ag&&Y){w(ah,false);K(function(){ae+="";ag+="";var aj={};if(af&&typeof af===r){for(var al in af){aj[al]=af[al]}}aj.data=ab;aj.width=ae;aj.height=ag;var am={};if(ad&&typeof ad===r){for(var ak in ad){am[ak]=ad[ak]}}if(Z&&typeof Z===r){for(var ai in Z){if(typeof am.flashvars!=D){am.flashvars+="&"+ai+"="+Z[ai]}else{am.flashvars=ai+"="+Z[ai]}}}if(F(Y)){var an=u(aj,am,ah);if(aj.id==ah){w(ah,true)}X.success=true;X.ref=an}else{if(aa&&A()){aj.data=aa;P(aj,am,ah,ac);return}else{w(ah,true)}}if(ac){ac(X)}})}else{if(ac){ac(X)}}},switchOffAutoHideShow:function(){m=false},ua:M,getFlashPlayerVersion:function(){return{major:M.pv[0],minor:M.pv[1],release:M.pv[2]}},hasFlashPlayerVersion:F,createSWF:function(Z,Y,X){if(M.w3){return u(Z,Y,X)}else{return undefined}},showExpressInstall:function(Z,aa,X,Y){if(M.w3&&A()){P(Z,aa,X,Y)}},removeSWF:function(X){if(M.w3){y(X)}},createCSS:function(aa,Z,Y,X){if(M.w3){v(aa,Z,Y,X)}},addDomLoadEvent:K,addLoadEvent:s,getQueryParamValue:function(aa){var Z=j.location.search||j.location.hash;if(Z){if(/\?/.test(Z)){Z=Z.split("?")[1]}if(aa==null){return L(Z)}var Y=Z.split("&");for(var X=0;X<Y.length;X++){if(Y[X].substring(0,Y[X].indexOf("="))==aa){return L(Y[X].substring((Y[X].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(a){var X=c(R);if(X&&l){X.parentNode.replaceChild(l,X);if(Q){w(Q,true);if(M.ie&&M.win){l.style.display="block"}}if(E){E(B)}}a=false}}}}();
@@ -0,0 +1,38 @@
1
+ class CreateAlbums < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :albums do |t|
4
+ t.string :title
5
+ t.string :filename
6
+ t.text :desc
7
+ t.boolean :active
8
+ t.string :heading
9
+ t.string :nav
10
+ t.timestamps
11
+ end
12
+
13
+ AdminMenuItem.create({:title =>"Albums", :controller_name => "albums", :url => "/albums"})
14
+ MenuItem.create({:title => "All Albums", :url => "all/albums", :active => true})
15
+
16
+ create_table :photos do |t|
17
+ t.string :title
18
+ t.text :desc
19
+ t.date :date_shot
20
+ t.string :location
21
+ t.integer :album_id
22
+ t.string :file_file_name
23
+ t.string :file_content_type
24
+ t.integer :file_file_size
25
+ t.datetime :file_updated_at
26
+ t.integer :parent_id
27
+ t.integer :lft
28
+ t.integer :rgt
29
+ t.timestamps
30
+ end
31
+
32
+ end
33
+
34
+ def self.down
35
+ drop_table :albums
36
+ drop_table :photos
37
+ end
38
+ end
@@ -0,0 +1,16 @@
1
+ #uploadify h3 { display:block; text-align:center; color:#767D87; font-weight: normal; }
2
+
3
+ #uploads{overflow:hidden;}
4
+ .photo { text-align:center; float:left; width:100px; height:150px; margin: 5px; }
5
+
6
+ tr.even td { background: #fff;}
7
+
8
+ table.photos{ margin: 0 auto; width:100%; border:1px solid #C5CCD6; }
9
+ table.photos tr th { background: #D3DAE6; padding:5px; }
10
+ table.photos tr.even td { background: #D3DAE6; padding:15px;}
11
+ table.photos tr.odd td { padding:15px;}
12
+
13
+ #uploads li{ float:left; padding:5px; width:100px; height:125px; }
14
+ .photo{ width:90px; height:125px; padding:5px; text-align:center; }
15
+
16
+ .placeHolder div { background-color:white !important; border:dashed 1px gray !important; }
@@ -0,0 +1,15 @@
1
+ /*================================================ ALBUMS =======================================================*/
2
+
3
+ #uploadify h3 { display:block; text-align:center; color:#767D87; font-weight: normal; }
4
+
5
+ tr.even td { background: #fff;}
6
+
7
+ #uploads{overflow:hidden; width: 845px; margin:0 auto}
8
+ .photo { text-align:center; float:left; width:130px; height: 175px; margin: 5px; }
9
+ .album_thumb{ width: 288px; height:125px; margin:10px; float:left }
10
+ .album_thumb a{ text-align:left; }
11
+
12
+ table.photos{ margin: 0 auto; width:100%; border:1px solid #C5CCD6; }
13
+ tr th { background: #D3DAE6; padding:5px; }
14
+ tr.even td { background: #D3DAE6; padding:15px;}
15
+ tr.odd td { padding:15px;}
@@ -0,0 +1,84 @@
1
+ /*
2
+ Uploadify v2.1.0
3
+ Release Date: August 24, 2009
4
+
5
+ Copyright (c) 2009 Ronnie Garcia, Travis Nickels
6
+
7
+ Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ of this software and associated documentation files (the "Software"), to deal
9
+ in the Software without restriction, including without limitation the rights
10
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ copies of the Software, and to permit persons to whom the Software is
12
+ furnished to do so, subject to the following conditions:
13
+
14
+ The above copyright notice and this permission notice shall be included in
15
+ all copies or substantial portions of the Software.
16
+
17
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ THE SOFTWARE.
24
+ */
25
+ .uploadifyQueue {
26
+ position:relative;
27
+ top:30px;
28
+ left: -14px;
29
+ width: 238px;
30
+ padding: 0;
31
+ }
32
+
33
+ .uploadifyButtons {
34
+ width: 207px;
35
+ margin: 5px auto;
36
+ position:relative;
37
+ }
38
+
39
+ .uploadifyButtons #photo_submit {
40
+ position: absolute;
41
+ right: 0px ;
42
+ }
43
+
44
+ .uploadifyButtons object {
45
+ position: absolute;
46
+ left: 0px ;
47
+ }
48
+
49
+
50
+ .uploadifyQueueItem {
51
+ font: 11px Helvetica, Arial, sans-serif;
52
+ border: 1px solid #E5E5E5;
53
+ background-color: #F5F5F5;
54
+ margin: 5px 0px ;
55
+ padding: 10px;
56
+ width: 215px;
57
+ }
58
+ .uploadifyError {
59
+ border: 2px solid #FBCBBC !important;
60
+ background-color: #FDE5DD !important;
61
+ }
62
+ .uploadifyQueueItem .cancel {
63
+ float: right;
64
+ }
65
+ .uploadifyProgress {
66
+ background-color: #FFFFFF;
67
+ border-top: 1px solid #808080;
68
+ border-left: 1px solid #808080;
69
+ border-right: 1px solid #C5C5C5;
70
+ border-bottom: 1px solid #C5C5C5;
71
+ margin-top: 10px;
72
+ width: 100%;
73
+ }
74
+ .uploadifyProgressBar {
75
+ background-color: #545C6D;
76
+ width: 1px;
77
+ height: 3px;
78
+ }
79
+
80
+ .cancel img {
81
+ border: none;
82
+ padding: none;
83
+ margin: none;
84
+ }
@@ -0,0 +1,23 @@
1
+ Description:
2
+ The nifty_config generator creates YAML file in your config
3
+ directory and an initializer to load this config. The config has a
4
+ separate section for each environment. This is a great place to put
5
+ any config settings you don't want in your app.
6
+
7
+ The config is loaded into a constant called APP_CONFIG by default,
8
+ this changes depending on the name you choose to pass the generator.
9
+ Use this constant to access the config settings like this.
10
+
11
+ APP_CONFIG[:some_setting]
12
+
13
+
14
+ Examples:
15
+ script/generate nifty_config
16
+
17
+ Config: config/app_config.yml
18
+ Initializer: config/initializers/load_app_config.rb
19
+
20
+ script/generate nifty_config passwords
21
+
22
+ Config: config/passwords_config.yml
23
+ Initializer: config/initializers/load_passwords_config.rb
@@ -0,0 +1,32 @@
1
+ class DustConfigGenerator < Rails::Generator::Base
2
+ def initialize(runtime_args, runtime_options = {})
3
+ super
4
+ @name = @args.first || 'app'
5
+ end
6
+
7
+ def manifest
8
+ record do |m|
9
+ m.directory 'config/initializers'
10
+
11
+ m.template "load_config.rb", "config/initializers/load_#{file_name}_config.rb"
12
+ m.file "config.yml", "config/#{file_name}_config.yml"
13
+ end
14
+ end
15
+
16
+ def file_name
17
+ @name.underscore
18
+ end
19
+
20
+ def constant_name
21
+ @name.underscore.upcase
22
+ end
23
+
24
+ protected
25
+ def banner
26
+ <<-EOS
27
+ Creates config and loader files.
28
+
29
+ USAGE: #{$0} #{spec.name} [config_name]
30
+ EOS
31
+ end
32
+ end
@@ -0,0 +1,8 @@
1
+ development:
2
+ domain: localhost:3000
3
+
4
+ test:
5
+ domain: test.host
6
+
7
+ production:
8
+ domain: example.com
@@ -0,0 +1,2 @@
1
+ raw_config = File.read(RAILS_ROOT + "/config/<%= file_name %>_config.yml")
2
+ <%= constant_name %>_CONFIG = YAML.load(raw_config)[RAILS_ENV].symbolize_keys
@@ -0,0 +1,51 @@
1
+ Description:
2
+ Scaffolds an entire resource, from model and migration to controller and
3
+ views. The resource is ready to use as a starting point for your restful,
4
+ resource-oriented application. Tests or specs are also generated depending
5
+ on if you have a "spec" directory or not.
6
+
7
+ IMPORTANT: This generator uses the "title" helper method which is generated
8
+ by the nifty_layout generator. You may want to run that generator first.
9
+
10
+ Usage:
11
+ Pass the name of the model, either CamelCased or under_scored, as the first
12
+ argument along with an optional list of attribute pairs and controller actions.
13
+
14
+ If no controller actions are specified, they will default to index, show,
15
+ new, create, edit, update, and destroy.
16
+
17
+ IMPORTANT: If no attribute pairs are specified, no model will be generated.
18
+ It will try to determine the attributes from an existing model.
19
+
20
+ Attribute pairs are column_name:sql_type arguments specifying the
21
+ model's attributes. Timestamps are added by default, so you don't have to
22
+ specify them by hand as 'created_at:datetime updated_at:datetime'.
23
+
24
+ For example, `nifty_scaffold post name:string content:text hidden:boolean`
25
+ gives you a model with those three attributes, a controller that handles
26
+ the create/show/update/destroy, forms to create and edit your posts, and
27
+ an index that lists them all, as well as a map.resources :posts
28
+ declaration in config/routes.rb.
29
+
30
+ Adding an "!" in the mix of arguments will invert the passed controller
31
+ actions. This will include all 7 controller actitons except the ones
32
+ mentioned. This option doesn't affect model attributes.
33
+
34
+ Examples:
35
+ script/generate nifty_scaffold post
36
+
37
+ Will create a controller called "posts" it will contain all seven
38
+ CRUD actions along with the views. A model will NOT be created,
39
+ instead it will look for an existing model and use those attributes.
40
+
41
+ script/generate nifty_scaffold post name:string content:text index new edit
42
+
43
+ Will create a Post model and migration file with the name and content
44
+ attributes. It will also create a controller with index, new, create,
45
+ edit, and update actions. Notice the create and update actions are
46
+ added automatically with new and edit.
47
+
48
+ script/generate nifty_scaffold post ! show new
49
+
50
+ Creates a posts controller (no model) with index, edit, update, and
51
+ destroy actions.