bivouac 0.2.2 → 0.2.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.
Files changed (45) hide show
  1. data/README +15 -0
  2. data/bin/bivouac +45 -8
  3. data/doc/rdoc/classes/BivouacHelpers/FormView.html +157 -122
  4. data/doc/rdoc/classes/BivouacHelpers/JavaScriptView.html +1 -1
  5. data/doc/rdoc/created.rid +1 -1
  6. data/doc/rdoc/files/README.html +41 -1
  7. data/doc/rdoc/files/lib/bivouac/helpers/view/goh/form_rb.html +1 -1
  8. data/doc/rdoc/files/lib/bivouac/helpers/view/goh/javascript_rb.html +1 -1
  9. data/examples/bivouac_sample/Rakefile +20 -0
  10. data/examples/bivouac_sample/app/bivouac_sample.rb +12 -4
  11. data/examples/bivouac_sample/app/controllers/edit_in_place.rb +17 -0
  12. data/examples/bivouac_sample/app/controllers/index.rb +11 -1
  13. data/examples/bivouac_sample/app/controllers/not_found.rb +16 -0
  14. data/examples/bivouac_sample/app/helpers/_helpers.rb +5 -3
  15. data/examples/bivouac_sample/app/views/edit_in_place.rb +52 -0
  16. data/examples/bivouac_sample/app/views/index.rb +21 -11
  17. data/examples/bivouac_sample/app/views/not_found.rb +13 -0
  18. data/examples/bivouac_sample/config/database.yml +3 -0
  19. data/examples/bivouac_sample/config/environment.rb +3 -2
  20. data/examples/bivouac_sample/config/postamble.rb +104 -44
  21. data/examples/bivouac_sample/script/generate +6 -0
  22. data/examples/bivouac_sample/test/test_edit_in_place.rb +22 -0
  23. data/examples/bivouac_sample/test/test_index.rb +22 -0
  24. data/lib/bivouac/commands/generate.rb +34 -13
  25. data/lib/bivouac/commands/generate.rb_OLD +342 -0
  26. data/lib/bivouac/helpers/view/goh/form.rb +33 -9
  27. data/lib/bivouac/helpers/view/goh/javascript.rb +1 -1
  28. data/lib/bivouac/template/application/postamble.rb +3 -3
  29. data/lib/bivouac/template/application_goh.rb +21 -3
  30. data/lib/bivouac/template/environment.rb +7 -2
  31. data/lib/bivouac/template/generate/create.rb +3 -5
  32. data/lib/bivouac/template/generate/migrate.rb +1 -2
  33. data/lib/bivouac/template/generate/migrate_begin.rb +11 -0
  34. data/lib/bivouac/template/generate/migrate_column.rb +1 -0
  35. data/lib/bivouac/template/generate/migrate_end.rb +8 -0
  36. data/lib/bivouac/template/generate/migration_add.rb +1 -0
  37. data/lib/bivouac/template/generate/migration_begin.rb +10 -0
  38. data/lib/bivouac/template/generate/migration_end.rb +3 -0
  39. data/lib/bivouac/template/generate/migration_middle.rb +3 -0
  40. data/lib/bivouac/template/generate/migration_remove.rb +1 -0
  41. data/lib/bivouac/template/static/default_layout_view.rb +33 -0
  42. data/lib/bivouac/template/static/not_found_controller.rb +16 -0
  43. data/lib/bivouac/template/static/not_found_view.rb +13 -0
  44. data/lib/cookies_sessions.rb +39 -0
  45. metadata +23 -3
data/README CHANGED
@@ -20,6 +20,21 @@ Bivouac is a simple generator for camping[http://code.whytheluckystiff.net/campi
20
20
 
21
21
  == FEATURES/PROBLEMS:
22
22
 
23
+ === 0.2.3:
24
+
25
+ * Ruby 1.9... not yet !
26
+ * Database configuration use YAML
27
+ * Add not_found controller and view
28
+ * Remove :id column definition in migrate.rb
29
+ * Add helper FormView#editable_content from
30
+ http://blog.codahale.com/2006/01/14/a-rails-howto-simplify-in-place-editing-with-scriptaculous/
31
+ Example at http://bivouac.rubyforge.org/svn/trunk/bivouac/examples/bivouac_sample/
32
+ * model generator now work with column name and type. Example :
33
+ ruby script/generate model user name:string mail:string
34
+ * Add Multiple Layouts support (see http://rubyforge.org/pipermail/camping-list/2008-May/000729.html)
35
+ * Thin is not more the default server (because layouts don't work with Thin :()
36
+ * Add Cookie session support. Use -S to specify session type (db or cookie - default).
37
+
23
38
  === 0.2.2:
24
39
  * Postamble has been completely rewritten. So :
25
40
 
data/bin/bivouac CHANGED
@@ -9,6 +9,7 @@ require 'optparse'
9
9
  require 'ostruct'
10
10
  require 'active_support'
11
11
  require 'fileutils'
12
+ require 'yaml'
12
13
 
13
14
  require 'bivouac/template'
14
15
  include Bivouac::Template
@@ -17,7 +18,13 @@ include Bivouac::Template
17
18
  database_configuration = {
18
19
  :adapter => "sqlite3"
19
20
  }
20
- @conf = OpenStruct.new( :db => "{\n\t:adapter => 'sqlite3'\n\t:database => 'db/bivouac.db'\n}", :orgtype => "GOH", :port => 3301, :address => "0.0.0.0" )
21
+ @conf = OpenStruct.new(
22
+ :db => { :adapter => 'sqlite3', :database => 'db/bivouac.db' },
23
+ :orgtype => "GOH",
24
+ :port => 3301,
25
+ :address => "0.0.0.0",
26
+ :session => :cookie
27
+ )
21
28
 
22
29
  opts = OptionParser.new do |opts|
23
30
  opts.banner = "Usage: bivouac [options] app"
@@ -50,12 +57,24 @@ opts = OptionParser.new do |opts|
50
57
  exit
51
58
  end
52
59
 
53
- @conf.db = "{\n\t:adapter => '#{dbtype}'\n\t:database => 'db/bivouac.db'\n}"
60
+ @conf.db = {:adapter => dbtype, :database => 'db/bivouac.db'}
54
61
  }
55
62
 
56
- opts.on("-P", "--port PORT", "Which port to bind to (3301)") { |@conf.port| }
63
+ opts.on("-P", "--port PORT", "Which port to bind to (3301)") { |port|
64
+ @conf.port = port
65
+ }
57
66
 
58
- opts.on("-a", "--address ADDR", "Address to bind to (0.0.0.0)") { |@conf.address| }
67
+ opts.on("-a", "--address ADDR", "Address to bind to (0.0.0.0)") { |address|
68
+ @conf.address = address
69
+ }
70
+
71
+ opts.on("-S", "--session TYPE", "Session type (db|cookie). Default : cookie") { |session|
72
+ @conf.session = session.to_sym
73
+ unless [:db, :cookie].include?( @conf.session )
74
+ puts opts
75
+ exit
76
+ end
77
+ }
59
78
 
60
79
  opts.separator ""
61
80
  opts.separator "Common options:"
@@ -96,12 +115,10 @@ if database_configuration[:adapter] =~ /sqlite/
96
115
  else
97
116
  database_configuration[:database] = @conf.appdir
98
117
  end
99
- @conf.db = database_configuration.inspect
100
-
101
- ## REMOVE ME ## ---------------- @appname = @conf.appname
118
+ @conf.db = database_configuration
102
119
 
103
120
  # Create Application Directories
104
- createDir( @conf.appdir )
121
+ createDir( @conf.appdir ) ## TODO: Replace by createDir( name ) to keep the given name
105
122
  createDir( "#{@conf.appdir}/config" )
106
123
  createDir( "#{@conf.appdir}/app" )
107
124
  createDir( "#{@conf.appdir}/app/controllers" )
@@ -125,6 +142,11 @@ createFile( "#{@conf.appdir}/config/environment.rb" ) { |io|
125
142
  io.puts template( "environment" )
126
143
  }
127
144
 
145
+ # Create Database configuration file
146
+ createFile( "#{@conf.appdir}/config/database.yml" ) { |io|
147
+ io.puts YAML.dump( @conf.db )
148
+ }
149
+
128
150
  # Create Application Postamble file
129
151
  createFile( "#{@conf.appdir}/config/postamble.rb" ) { |io|
130
152
  io.puts template( "application/postamble" )
@@ -177,3 +199,18 @@ copyTemplate( "static/autocomplete.css", "#{@conf.appdir}/public/stylesheets" )
177
199
  createFile( "#{@conf.appdir}/app/controllers/index.rb" ) { |io|
178
200
  io.puts template( "static/index" )
179
201
  }
202
+
203
+ # Create not_found controller
204
+ createFile( "#{@conf.appdir}/app/controllers/not_found.rb" ) { |io|
205
+ io.puts template( "static/not_found_controller" )
206
+ }
207
+
208
+ # Create not_found view
209
+ createFile( "#{@conf.appdir}/app/views/not_found.rb" ) { |io|
210
+ io.puts template( "static/not_found_view" )
211
+ }
212
+
213
+ # Create default_layout view
214
+ createFile( "#{@conf.appdir}/app/views/default_layout.rb" ) { |io|
215
+ io.puts template( "static/default_layout_view" )
216
+ }
@@ -131,7 +131,7 @@ ID specified by <tt>field_id</tt>.
131
131
  </div>
132
132
  </div>
133
133
  <h4 class="ruled">Public Instance method:
134
- <strong><a name="M000047">button_to_function(name, *args, &amp;block)</a></strong> <a href="#M000047"><img src="../../permalink.gif" border="0" title="Permalink to Public Instance method: button_to_function" /></a></h4>
134
+ <strong><a name="M000048">button_to_function(name, *args, &amp;block)</a></strong> <a href="#M000048"><img src="../../permalink.gif" border="0" title="Permalink to Public Instance method: button_to_function" /></a></h4>
135
135
 
136
136
  <p>
137
137
  Returns a button that&#8216;ll trigger a JavaScript function using the
@@ -144,26 +144,63 @@ making an Ajax request first).
144
144
  </p>
145
145
 
146
146
  <div class="sourcecode">
147
- <p class="source-link">[ <a href="javascript:toggleSource('M000047_source')" id="l_M000047_source">show source</a> ]</p>
148
- <div id="M000047_source" class="dyn-source">
147
+ <p class="source-link">[ <a href="javascript:toggleSource('M000048_source')" id="l_M000048_source">show source</a> ]</p>
148
+ <div id="M000048_source" class="dyn-source">
149
149
  <pre>
150
- <span class="ruby-comment cmt"># File lib/bivouac/helpers/view/goh/form.rb, line 63</span>
151
- 63: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">button_to_function</span>(<span class="ruby-identifier">name</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
152
- 64: <span class="ruby-identifier">html_options</span> = <span class="ruby-identifier">args</span>.<span class="ruby-identifier">last</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Hash</span>) <span class="ruby-operator">?</span> <span class="ruby-identifier">args</span>.<span class="ruby-identifier">pop</span> <span class="ruby-operator">:</span> {}
153
- 65: <span class="ruby-identifier">function</span> = <span class="ruby-identifier">args</span>[<span class="ruby-value">0</span>] <span class="ruby-operator">||</span> <span class="ruby-value str">''</span>
154
- 66:
155
- 67: <span class="ruby-identifier">function</span> = <span class="ruby-identifier">update_page</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
156
- 68:
157
- 69: <span class="ruby-identifier">input</span>( <span class="ruby-identifier">html_options</span>.<span class="ruby-identifier">merge</span>({
158
- 70: <span class="ruby-identifier">:type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">&quot;button&quot;</span>, <span class="ruby-identifier">:value</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">name</span>,
159
- 71: <span class="ruby-identifier">:onclick</span> =<span class="ruby-operator">&gt;</span> (<span class="ruby-identifier">html_options</span>[<span class="ruby-identifier">:onclick</span>] <span class="ruby-operator">?</span> <span class="ruby-node">&quot;#{html_options[:onclick]}; &quot;</span> <span class="ruby-operator">:</span> <span class="ruby-value str">&quot;&quot;</span>) <span class="ruby-operator">+</span> <span class="ruby-node">&quot;#{function};&quot;</span>
160
- 72: }))
161
- 73: <span class="ruby-keyword kw">end</span>
150
+ <span class="ruby-comment cmt"># File lib/bivouac/helpers/view/goh/form.rb, line 87</span>
151
+ 87: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">button_to_function</span>(<span class="ruby-identifier">name</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
152
+ 88: <span class="ruby-identifier">html_options</span> = <span class="ruby-identifier">args</span>.<span class="ruby-identifier">last</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Hash</span>) <span class="ruby-operator">?</span> <span class="ruby-identifier">args</span>.<span class="ruby-identifier">pop</span> <span class="ruby-operator">:</span> {}
153
+ 89: <span class="ruby-identifier">function</span> = <span class="ruby-identifier">args</span>[<span class="ruby-value">0</span>] <span class="ruby-operator">||</span> <span class="ruby-value str">''</span>
154
+ 90:
155
+ 91: <span class="ruby-identifier">function</span> = <span class="ruby-identifier">update_page</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
156
+ 92:
157
+ 93: <span class="ruby-identifier">input</span>( <span class="ruby-identifier">html_options</span>.<span class="ruby-identifier">merge</span>({
158
+ 94: <span class="ruby-identifier">:type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">&quot;button&quot;</span>, <span class="ruby-identifier">:value</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">name</span>,
159
+ 95: <span class="ruby-identifier">:onclick</span> =<span class="ruby-operator">&gt;</span> (<span class="ruby-identifier">html_options</span>[<span class="ruby-identifier">:onclick</span>] <span class="ruby-operator">?</span> <span class="ruby-node">&quot;#{html_options[:onclick]}; &quot;</span> <span class="ruby-operator">:</span> <span class="ruby-value str">&quot;&quot;</span>) <span class="ruby-operator">+</span> <span class="ruby-node">&quot;#{function};&quot;</span>
160
+ 96: }))
161
+ 97: <span class="ruby-keyword kw">end</span>
162
162
  </pre>
163
163
  </div>
164
164
  </div>
165
165
  <h4 class="ruled">Public Instance method:
166
- <strong><a name="M000050">form_remote_tag(options = {}, &amp;block)</a></strong> <a href="#M000050"><img src="../../permalink.gif" border="0" title="Permalink to Public Instance method: form_remote_tag" /></a></h4>
166
+ <strong><a name="M000046">editable_content(options)</a></strong> <a href="#M000046"><img src="../../permalink.gif" border="0" title="Permalink to Public Instance method: editable_content" /></a></h4>
167
+
168
+ <p>
169
+ <a
170
+ href="http://blog.codahale.com/2006/01/14/a-rails-howto-simplify-in-place-editing-with-scriptaculous">blog.codahale.com/2006/01/14/a-rails-howto-simplify-in-place-editing-with-scriptaculous</a>/
171
+ </p>
172
+
173
+ <div class="sourcecode">
174
+ <p class="source-link">[ <a href="javascript:toggleSource('M000046_source')" id="l_M000046_source">show source</a> ]</p>
175
+ <div id="M000046_source" class="dyn-source">
176
+ <pre>
177
+ <span class="ruby-comment cmt"># File lib/bivouac/helpers/view/goh/form.rb, line 20</span>
178
+ 20: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">editable_content</span>(<span class="ruby-identifier">options</span>)
179
+ 21: <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:content</span>] = { <span class="ruby-identifier">:element</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'span'</span> }.<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">options</span>[<span class="ruby-identifier">:content</span>])
180
+ 22: <span class="ruby-comment cmt"># options[:url] = {}.merge(options[:url])</span>
181
+ 23: <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:ajax</span>] = { <span class="ruby-identifier">:okText</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">&quot;'Save'&quot;</span>, <span class="ruby-identifier">:cancelText</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">&quot;'Cancel'&quot;</span>}.<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">options</span>[<span class="ruby-identifier">:ajax</span>] <span class="ruby-operator">||</span> {})
182
+ 24: <span class="ruby-identifier">script</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>
183
+ 25: <span class="ruby-identifier">script</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;new Ajax.InPlaceEditor(&quot;</span>
184
+ 26: <span class="ruby-identifier">script</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot; '#{options[:content][:options][:id]}',&quot;</span>
185
+ 27: <span class="ruby-identifier">script</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot; '#{options[:url]}',&quot;</span>
186
+ 28: <span class="ruby-identifier">script</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot; {&quot;</span>
187
+ 29: <span class="ruby-identifier">script</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:ajax</span>].<span class="ruby-identifier">map</span>{ <span class="ruby-operator">|</span><span class="ruby-identifier">key</span>, <span class="ruby-identifier">value</span><span class="ruby-operator">|</span> <span class="ruby-node">&quot;#{key.to_s}: #{value}&quot;</span> }.<span class="ruby-identifier">join</span>(<span class="ruby-value str">&quot;, &quot;</span>)
188
+ 30: <span class="ruby-identifier">script</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot; }&quot;</span>
189
+ 31: <span class="ruby-identifier">script</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;)&quot;</span>
190
+ 32:
191
+ 33: <span class="ruby-identifier">send</span>(
192
+ 34: <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:content</span>][<span class="ruby-identifier">:element</span>],
193
+ 35: <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:content</span>][<span class="ruby-identifier">:text</span>],
194
+ 36: <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:content</span>][<span class="ruby-identifier">:options</span>]
195
+ 37: )
196
+ 38:
197
+ 39: <span class="ruby-identifier">javascript_tag</span>( <span class="ruby-identifier">script</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">&quot;\n&quot;</span>) )
198
+ 40: <span class="ruby-keyword kw">end</span>
199
+ </pre>
200
+ </div>
201
+ </div>
202
+ <h4 class="ruled">Public Instance method:
203
+ <strong><a name="M000051">form_remote_tag(options = {}, &amp;block)</a></strong> <a href="#M000051"><img src="../../permalink.gif" border="0" title="Permalink to Public Instance method: form_remote_tag" /></a></h4>
167
204
 
168
205
  <p>
169
206
  Returns a form tag that will submit using XMLHttpRequest in the background
@@ -185,15 +222,15 @@ Example:
185
222
  </pre>
186
223
  <p>
187
224
  The Hash passed to the :html key is equivalent to the options (2nd)
188
- argument in the <a href="FormView.html#M000049">form_tag</a> method.
225
+ argument in the <a href="FormView.html#M000050">form_tag</a> method.
189
226
  </p>
190
227
  <p>
191
228
  By default the fall-through action is the same as the one specified in the
192
229
  :url (and the default method is :post).
193
230
  </p>
194
231
  <p>
195
- <a href="FormView.html#M000050">form_remote_tag</a> takes a block, like <a
196
- href="FormView.html#M000049">form_tag</a>:
232
+ <a href="FormView.html#M000051">form_remote_tag</a> takes a block, like <a
233
+ href="FormView.html#M000050">form_tag</a>:
197
234
  </p>
198
235
  <pre>
199
236
  form_remote_tag :url =&gt; '/posts' do
@@ -202,25 +239,25 @@ href="FormView.html#M000049">form_tag</a>:
202
239
  </pre>
203
240
 
204
241
  <div class="sourcecode">
205
- <p class="source-link">[ <a href="javascript:toggleSource('M000050_source')" id="l_M000050_source">show source</a> ]</p>
206
- <div id="M000050_source" class="dyn-source">
242
+ <p class="source-link">[ <a href="javascript:toggleSource('M000051_source')" id="l_M000051_source">show source</a> ]</p>
243
+ <div id="M000051_source" class="dyn-source">
207
244
  <pre>
208
- <span class="ruby-comment cmt"># File lib/bivouac/helpers/view/goh/form.rb, line 159</span>
209
- 159: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">form_remote_tag</span>(<span class="ruby-identifier">options</span> = {}, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
210
- 160: <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:form</span>] = <span class="ruby-keyword kw">true</span>
211
- 161:
212
- 162: <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:html</span>] <span class="ruby-operator">||=</span> {}
213
- 163: <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:html</span>][<span class="ruby-identifier">:onsubmit</span>] =
214
- 164: (<span class="ruby-identifier">options</span>[<span class="ruby-identifier">:html</span>][<span class="ruby-identifier">:onsubmit</span>] <span class="ruby-operator">?</span> <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:html</span>][<span class="ruby-identifier">:onsubmit</span>] <span class="ruby-operator">+</span> <span class="ruby-value str">&quot;; &quot;</span> <span class="ruby-operator">:</span> <span class="ruby-value str">&quot;&quot;</span>) <span class="ruby-operator">+</span>
215
- 165: <span class="ruby-node">&quot;#{remote_function(options)}; return false;&quot;</span>
216
- 166:
217
- 167: <span class="ruby-identifier">form_tag</span>( <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:html</span>].<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">:url</span>), <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:html</span>], <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span> )
218
- 168: <span class="ruby-keyword kw">end</span>
245
+ <span class="ruby-comment cmt"># File lib/bivouac/helpers/view/goh/form.rb, line 183</span>
246
+ 183: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">form_remote_tag</span>(<span class="ruby-identifier">options</span> = {}, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
247
+ 184: <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:form</span>] = <span class="ruby-keyword kw">true</span>
248
+ 185:
249
+ 186: <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:html</span>] <span class="ruby-operator">||=</span> {}
250
+ 187: <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:html</span>][<span class="ruby-identifier">:onsubmit</span>] =
251
+ 188: (<span class="ruby-identifier">options</span>[<span class="ruby-identifier">:html</span>][<span class="ruby-identifier">:onsubmit</span>] <span class="ruby-operator">?</span> <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:html</span>][<span class="ruby-identifier">:onsubmit</span>] <span class="ruby-operator">+</span> <span class="ruby-value str">&quot;; &quot;</span> <span class="ruby-operator">:</span> <span class="ruby-value str">&quot;&quot;</span>) <span class="ruby-operator">+</span>
252
+ 189: <span class="ruby-node">&quot;#{remote_function(options)}; return false;&quot;</span>
253
+ 190:
254
+ 191: <span class="ruby-identifier">form_tag</span>( <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:html</span>].<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">:url</span>), <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:html</span>], <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span> )
255
+ 192: <span class="ruby-keyword kw">end</span>
219
256
  </pre>
220
257
  </div>
221
258
  </div>
222
259
  <h4 class="ruled">Public Instance method:
223
- <strong><a name="M000049">form_tag(url, options = {}) {|| ...}</a></strong> <a href="#M000049"><img src="../../permalink.gif" border="0" title="Permalink to Public Instance method: form_tag" /></a></h4>
260
+ <strong><a name="M000050">form_tag(url, options = {}) {|| ...}</a></strong> <a href="#M000050"><img src="../../permalink.gif" border="0" title="Permalink to Public Instance method: form_tag" /></a></h4>
224
261
 
225
262
  <p>
226
263
  Starts a form tag that points the action to an url. The method for the form
@@ -230,11 +267,11 @@ defaults to POST.
230
267
  Examples:
231
268
  </p>
232
269
  <ul>
233
- <li><tt><a href="FormView.html#M000049">form_tag</a>(&#8217;/posts&#8217;)
270
+ <li><tt><a href="FormView.html#M000050">form_tag</a>(&#8217;/posts&#8217;)
234
271
  =&gt; &lt;form action=&quot;/posts&quot; method=&quot;post&quot;&gt;</tt>
235
272
 
236
273
  </li>
237
- <li><tt><a href="FormView.html#M000049">form_tag</a>(&#8217;/upload&#8217;,
274
+ <li><tt><a href="FormView.html#M000050">form_tag</a>(&#8217;/upload&#8217;,
238
275
  :multipart =&gt; true) =&gt; &lt;form action=&quot;/upload&quot;
239
276
  method=&quot;post&quot; enctype=&quot;multipart/form-data&quot;&gt;</tt>
240
277
 
@@ -273,118 +310,116 @@ either &quot;get&quot; or &quot;post&quot;.
273
310
  </ul>
274
311
 
275
312
  <div class="sourcecode">
276
- <p class="source-link">[ <a href="javascript:toggleSource('M000049_source')" id="l_M000049_source">show source</a> ]</p>
277
- <div id="M000049_source" class="dyn-source">
313
+ <p class="source-link">[ <a href="javascript:toggleSource('M000050_source')" id="l_M000050_source">show source</a> ]</p>
314
+ <div id="M000050_source" class="dyn-source">
278
315
  <pre>
279
- <span class="ruby-comment cmt"># File lib/bivouac/helpers/view/goh/form.rb, line 109</span>
280
- 109: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">form_tag</span>(<span class="ruby-identifier">url</span>, <span class="ruby-identifier">options</span> = {}, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
281
- 110: <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:enctype</span>] = <span class="ruby-value str">&quot;multipart/form-data&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">:multipart</span>)
282
- 111: <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:action</span>] = <span class="ruby-identifier">url</span>
283
- 112:
284
- 113: <span class="ruby-identifier">method_tag</span> = <span class="ruby-keyword kw">false</span>
285
- 114:
286
- 115: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">method</span> = <span class="ruby-identifier">options</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">:method</span>).<span class="ruby-identifier">to_s</span>
287
- 116: <span class="ruby-keyword kw">when</span> <span class="ruby-regexp re">/^get$/i</span> <span class="ruby-comment cmt"># must be case-insentive, but can't use downcase as might be nil</span>
288
- 117: <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:method</span>] = <span class="ruby-value str">&quot;get&quot;</span>
289
- 118: <span class="ruby-keyword kw">when</span> <span class="ruby-regexp re">/^post$/i</span>, <span class="ruby-value str">&quot;&quot;</span>, <span class="ruby-keyword kw">nil</span>
290
- 119: <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:method</span>] = <span class="ruby-value str">&quot;post&quot;</span>
291
- 120: <span class="ruby-keyword kw">else</span>
292
- 121: <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:method</span>] = <span class="ruby-value str">&quot;post&quot;</span>
293
- 122: <span class="ruby-identifier">method_tag</span> = <span class="ruby-keyword kw">true</span>
294
- 123: <span class="ruby-keyword kw">end</span>
295
- 124:
296
- 125: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
297
- 126: <span class="ruby-identifier">form</span>( <span class="ruby-identifier">options</span> ) <span class="ruby-keyword kw">do</span>
298
- 127: <span class="ruby-keyword kw">yield</span>( )
299
- 128: <span class="ruby-identifier">input</span>( <span class="ruby-identifier">:type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">&quot;hidden&quot;</span>, <span class="ruby-identifier">:name</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">&quot;_method&quot;</span>, <span class="ruby-identifier">:value</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">method</span> ) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">method_tag</span>
300
- 129: <span class="ruby-keyword kw">end</span>
301
- 130: <span class="ruby-keyword kw">else</span>
302
- 131: <span class="ruby-identifier">form</span>( <span class="ruby-identifier">options</span> ) <span class="ruby-keyword kw">do</span>; <span class="ruby-keyword kw">end</span>
303
- 132: <span class="ruby-keyword kw">end</span>
304
- 133: <span class="ruby-keyword kw">end</span>
316
+ <span class="ruby-comment cmt"># File lib/bivouac/helpers/view/goh/form.rb, line 133</span>
317
+ 133: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">form_tag</span>(<span class="ruby-identifier">url</span>, <span class="ruby-identifier">options</span> = {}, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
318
+ 134: <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:enctype</span>] = <span class="ruby-value str">&quot;multipart/form-data&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">:multipart</span>)
319
+ 135: <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:action</span>] = <span class="ruby-identifier">url</span>
320
+ 136:
321
+ 137: <span class="ruby-identifier">method_tag</span> = <span class="ruby-keyword kw">false</span>
322
+ 138:
323
+ 139: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">method</span> = <span class="ruby-identifier">options</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">:method</span>).<span class="ruby-identifier">to_s</span>
324
+ 140: <span class="ruby-keyword kw">when</span> <span class="ruby-regexp re">/^get$/i</span> <span class="ruby-comment cmt"># must be case-insentive, but can't use downcase as might be nil</span>
325
+ 141: <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:method</span>] = <span class="ruby-value str">&quot;get&quot;</span>
326
+ 142: <span class="ruby-keyword kw">when</span> <span class="ruby-regexp re">/^post$/i</span>, <span class="ruby-value str">&quot;&quot;</span>, <span class="ruby-keyword kw">nil</span>
327
+ 143: <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:method</span>] = <span class="ruby-value str">&quot;post&quot;</span>
328
+ 144: <span class="ruby-keyword kw">else</span>
329
+ 145: <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:method</span>] = <span class="ruby-value str">&quot;post&quot;</span>
330
+ 146: <span class="ruby-identifier">method_tag</span> = <span class="ruby-keyword kw">true</span>
331
+ 147: <span class="ruby-keyword kw">end</span>
332
+ 148:
333
+ 149: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
334
+ 150: <span class="ruby-identifier">form</span>( <span class="ruby-identifier">options</span> ) <span class="ruby-keyword kw">do</span>
335
+ 151: <span class="ruby-keyword kw">yield</span>( )
336
+ 152: <span class="ruby-identifier">input</span>( <span class="ruby-identifier">:type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">&quot;hidden&quot;</span>, <span class="ruby-identifier">:name</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">&quot;_method&quot;</span>, <span class="ruby-identifier">:value</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">method</span> ) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">method_tag</span>
337
+ 153: <span class="ruby-keyword kw">end</span>
338
+ 154: <span class="ruby-keyword kw">else</span>
339
+ 155: <span class="ruby-identifier">form</span>( <span class="ruby-identifier">options</span> ) <span class="ruby-keyword kw">do</span>; <span class="ruby-keyword kw">end</span>
340
+ 156: <span class="ruby-keyword kw">end</span>
341
+ 157: <span class="ruby-keyword kw">end</span>
305
342
  </pre>
306
343
  </div>
307
344
  </div>
308
345
  <h4 class="ruled">Public Instance method:
309
- <strong><a name="M000048">submit_to_remote(name, value, options = {})</a></strong> <a href="#M000048"><img src="../../permalink.gif" border="0" title="Permalink to Public Instance method: submit_to_remote" /></a></h4>
346
+ <strong><a name="M000049">submit_to_remote(name, value, options = {})</a></strong> <a href="#M000049"><img src="../../permalink.gif" border="0" title="Permalink to Public Instance method: submit_to_remote" /></a></h4>
310
347
 
311
348
  <p>
312
349
  Returns a button input tag that will submit form using XMLHttpRequest in
313
350
  the background instead of regular reloading POST arrangement.
314
351
  <tt>options</tt> argument is the same as in <tt><a
315
- href="FormView.html#M000050">form_remote_tag</a></tt>.
352
+ href="FormView.html#M000051">form_remote_tag</a></tt>.
316
353
  </p>
317
354
 
318
355
  <div class="sourcecode">
319
- <p class="source-link">[ <a href="javascript:toggleSource('M000048_source')" id="l_M000048_source">show source</a> ]</p>
320
- <div id="M000048_source" class="dyn-source">
356
+ <p class="source-link">[ <a href="javascript:toggleSource('M000049_source')" id="l_M000049_source">show source</a> ]</p>
357
+ <div id="M000049_source" class="dyn-source">
321
358
  <pre>
322
- <span class="ruby-comment cmt"># File lib/bivouac/helpers/view/goh/form.rb, line 78</span>
323
- 78: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">submit_to_remote</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">value</span>, <span class="ruby-identifier">options</span> = {})
324
- 79: <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:with</span>] <span class="ruby-operator">||=</span> <span class="ruby-value str">'Form.serialize(this.form)'</span>
325
- 80:
326
- 81: <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:html</span>] <span class="ruby-operator">||=</span> {}
327
- 82: <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:html</span>][<span class="ruby-identifier">:type</span>] = <span class="ruby-value str">'button'</span>
328
- 83: <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:html</span>][<span class="ruby-identifier">:onclick</span>] = <span class="ruby-node">&quot;#{remote_function(options)}; return false;&quot;</span>
329
- 84: <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:html</span>][<span class="ruby-identifier">:name</span>] = <span class="ruby-identifier">name</span>
330
- 85: <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:html</span>][<span class="ruby-identifier">:value</span>] = <span class="ruby-identifier">value</span>
331
- 86:
332
- 87: <span class="ruby-identifier">input</span> <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:html</span>]
333
- 88: <span class="ruby-keyword kw">end</span>
359
+ <span class="ruby-comment cmt"># File lib/bivouac/helpers/view/goh/form.rb, line 102</span>
360
+ 102: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">submit_to_remote</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">value</span>, <span class="ruby-identifier">options</span> = {})
361
+ 103: <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:with</span>] <span class="ruby-operator">||=</span> <span class="ruby-value str">'Form.serialize(this.form)'</span>
362
+ 104:
363
+ 105: <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:html</span>] <span class="ruby-operator">||=</span> {}
364
+ 106: <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:html</span>][<span class="ruby-identifier">:type</span>] = <span class="ruby-value str">'button'</span>
365
+ 107: <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:html</span>][<span class="ruby-identifier">:onclick</span>] = <span class="ruby-node">&quot;#{remote_function(options)}; return false;&quot;</span>
366
+ 108: <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:html</span>][<span class="ruby-identifier">:name</span>] = <span class="ruby-identifier">name</span>
367
+ 109: <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:html</span>][<span class="ruby-identifier">:value</span>] = <span class="ruby-identifier">value</span>
368
+ 110:
369
+ 111: <span class="ruby-identifier">input</span> <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:html</span>]
370
+ 112: <span class="ruby-keyword kw">end</span>
334
371
  </pre>
335
372
  </div>
336
373
  </div>
337
374
  <h4 class="ruled">Public Instance method:
338
- <strong><a name="M000046">text_field(field_name, value = &quot;&quot;, options = {})</a></strong> <a href="#M000046"><img src="../../permalink.gif" border="0" title="Permalink to Public Instance method: text_field" /></a></h4>
375
+ <strong><a name="M000047">text_field(field_name, value = &quot;&quot;, options = {})</a></strong> <a href="#M000047"><img src="../../permalink.gif" border="0" title="Permalink to Public Instance method: text_field" /></a></h4>
339
376
 
340
377
  <p>
341
378
  Autocomplete options :
342
379
  </p>
343
- <p>
344
- +:url+: URL to call for autocompletion results +:tokens+: +:frequency+:
345
- +:minChars+: +:indicator+: When sending the Ajax request Autocompleter
346
- shows this +:updateElement+: Hook for a custom function called after the
347
- element has been updated (i.e. when the user has selected an entry).
348
- +:afterUpdateElement+: Hook for a custom function called after the element
349
- has been updated (i.e. when the user has selected an entry). +:callback+:
350
- This function is called just before the Request is actually made, allowing
351
- you to modify the querystring that is sent to the server. +:parameters+: If
352
- you need to send any additional parameters through your search form, add
353
- them here, in the usual {field: &#8216;value&#8217;,another:
354
- &#8216;value&#8217;} or &#8216;field=value&amp;another=value&#8217; manner.
355
- </p>
380
+ <pre>
381
+ :url : URL to call for autocompletion results
382
+ :tokens:
383
+ :frequency :
384
+ :minChars :
385
+ :indicator : When sending the Ajax request Autocompleter shows this
386
+ :updateElement : Hook for a custom function called after the element has been updated (i.e. when the user has selected an entry).
387
+ :afterUpdateElement : Hook for a custom function called after the element has been updated (i.e. when the user has selected an entry).
388
+ :callback : This function is called just before the Request is actually made, allowing you to modify the querystring that is sent to the server.
389
+ :parameters : If you need to send any additional parameters through your search form, add them here, in the usual {field: 'value',another: 'value'} or 'field=value&amp;another=value' manner.
390
+ </pre>
356
391
 
357
392
  <div class="sourcecode">
358
- <p class="source-link">[ <a href="javascript:toggleSource('M000046_source')" id="l_M000046_source">show source</a> ]</p>
359
- <div id="M000046_source" class="dyn-source">
393
+ <p class="source-link">[ <a href="javascript:toggleSource('M000047_source')" id="l_M000047_source">show source</a> ]</p>
394
+ <div id="M000047_source" class="dyn-source">
360
395
  <pre>
361
- <span class="ruby-comment cmt"># File lib/bivouac/helpers/view/goh/form.rb, line 30</span>
362
- 30: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">text_field</span>(<span class="ruby-identifier">field_name</span>, <span class="ruby-identifier">value</span> = <span class="ruby-value str">&quot;&quot;</span>, <span class="ruby-identifier">options</span> = {})
363
- 31: <span class="ruby-identifier">autocomplete_options</span> = <span class="ruby-keyword kw">nil</span>
364
- 32:
365
- 33: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>.<span class="ruby-identifier">has_key?</span>( <span class="ruby-identifier">:autocomplete</span> )
366
- 34: <span class="ruby-keyword kw">unless</span> [<span class="ruby-value str">&quot;on&quot;</span>, <span class="ruby-value str">&quot;off&quot;</span>].<span class="ruby-identifier">include?</span>( <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:autocomplete</span>] )
367
- 35: <span class="ruby-identifier">autocomplete_options</span> = <span class="ruby-constant">Hash</span>.<span class="ruby-identifier">new</span>( )
368
- 36: <span class="ruby-identifier">autocomplete_options</span>[<span class="ruby-identifier">:url</span>] = <span class="ruby-identifier">options</span>.<span class="ruby-identifier">delete</span>( <span class="ruby-identifier">:autocomplete</span> )
369
- 37: <span class="ruby-comment cmt"># options[:autocomplete] = &quot;off&quot;</span>
370
- 38: <span class="ruby-keyword kw">end</span>
371
- 39: <span class="ruby-keyword kw">end</span>
372
- 40:
373
- 41:
374
- 42: [<span class="ruby-identifier">:tokens</span>, <span class="ruby-identifier">:frequency</span>, <span class="ruby-identifier">:minChars</span>, <span class="ruby-identifier">:indicator</span>, <span class="ruby-identifier">:updateElement</span>, <span class="ruby-identifier">:afterUpdateElement</span>, <span class="ruby-identifier">:callback</span>, <span class="ruby-identifier">:parameters</span>].<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">op</span><span class="ruby-operator">|</span>
375
- 43: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>.<span class="ruby-identifier">has_key?</span>( <span class="ruby-identifier">op</span> )
376
- 44: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">autocomplete_options</span>.<span class="ruby-identifier">nil?</span>
377
- 45: <span class="ruby-identifier">options</span>.<span class="ruby-identifier">delete</span>( <span class="ruby-identifier">op</span> )
378
- 46: <span class="ruby-keyword kw">else</span>
379
- 47: <span class="ruby-identifier">autocomplete_options</span>[<span class="ruby-identifier">op</span>] = <span class="ruby-identifier">options</span>.<span class="ruby-identifier">delete</span>( <span class="ruby-identifier">op</span> )
380
- 48: <span class="ruby-keyword kw">end</span>
381
- 49: <span class="ruby-keyword kw">end</span>
382
- 50: <span class="ruby-keyword kw">end</span>
383
- 51:
384
- 52: <span class="ruby-identifier">options</span> = { <span class="ruby-identifier">:id</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-node">&quot;default_#{Time.now.to_i}&quot;</span>, <span class="ruby-identifier">:type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">&quot;text&quot;</span>, <span class="ruby-identifier">:name</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">field_name</span>, <span class="ruby-identifier">:value</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">value</span> }.<span class="ruby-identifier">merge</span>( <span class="ruby-identifier">options</span> )
385
- 53: <span class="ruby-identifier">input</span>( <span class="ruby-identifier">options</span> )
386
- 54: <span class="ruby-identifier">auto_complete_field</span>( <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:id</span>], <span class="ruby-identifier">autocomplete_options</span> ) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">autocomplete_options</span>.<span class="ruby-identifier">nil?</span>
387
- 55: <span class="ruby-keyword kw">end</span>
396
+ <span class="ruby-comment cmt"># File lib/bivouac/helpers/view/goh/form.rb, line 54</span>
397
+ 54: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">text_field</span>(<span class="ruby-identifier">field_name</span>, <span class="ruby-identifier">value</span> = <span class="ruby-value str">&quot;&quot;</span>, <span class="ruby-identifier">options</span> = {})
398
+ 55: <span class="ruby-identifier">autocomplete_options</span> = <span class="ruby-keyword kw">nil</span>
399
+ 56:
400
+ 57: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>.<span class="ruby-identifier">has_key?</span>( <span class="ruby-identifier">:autocomplete</span> )
401
+ 58: <span class="ruby-keyword kw">unless</span> [<span class="ruby-value str">&quot;on&quot;</span>, <span class="ruby-value str">&quot;off&quot;</span>].<span class="ruby-identifier">include?</span>( <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:autocomplete</span>] )
402
+ 59: <span class="ruby-identifier">autocomplete_options</span> = <span class="ruby-constant">Hash</span>.<span class="ruby-identifier">new</span>( )
403
+ 60: <span class="ruby-identifier">autocomplete_options</span>[<span class="ruby-identifier">:url</span>] = <span class="ruby-identifier">options</span>.<span class="ruby-identifier">delete</span>( <span class="ruby-identifier">:autocomplete</span> )
404
+ 61: <span class="ruby-comment cmt"># options[:autocomplete] = &quot;off&quot;</span>
405
+ 62: <span class="ruby-keyword kw">end</span>
406
+ 63: <span class="ruby-keyword kw">end</span>
407
+ 64:
408
+ 65:
409
+ 66: [<span class="ruby-identifier">:tokens</span>, <span class="ruby-identifier">:frequency</span>, <span class="ruby-identifier">:minChars</span>, <span class="ruby-identifier">:indicator</span>, <span class="ruby-identifier">:updateElement</span>, <span class="ruby-identifier">:afterUpdateElement</span>, <span class="ruby-identifier">:callback</span>, <span class="ruby-identifier">:parameters</span>].<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">op</span><span class="ruby-operator">|</span>
410
+ 67: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>.<span class="ruby-identifier">has_key?</span>( <span class="ruby-identifier">op</span> )
411
+ 68: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">autocomplete_options</span>.<span class="ruby-identifier">nil?</span>
412
+ 69: <span class="ruby-identifier">options</span>.<span class="ruby-identifier">delete</span>( <span class="ruby-identifier">op</span> )
413
+ 70: <span class="ruby-keyword kw">else</span>
414
+ 71: <span class="ruby-identifier">autocomplete_options</span>[<span class="ruby-identifier">op</span>] = <span class="ruby-identifier">options</span>.<span class="ruby-identifier">delete</span>( <span class="ruby-identifier">op</span> )
415
+ 72: <span class="ruby-keyword kw">end</span>
416
+ 73: <span class="ruby-keyword kw">end</span>
417
+ 74: <span class="ruby-keyword kw">end</span>
418
+ 75:
419
+ 76: <span class="ruby-identifier">options</span> = { <span class="ruby-identifier">:id</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-node">&quot;default_#{Time.now.to_i}&quot;</span>, <span class="ruby-identifier">:type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">&quot;text&quot;</span>, <span class="ruby-identifier">:name</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">field_name</span>, <span class="ruby-identifier">:value</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">value</span> }.<span class="ruby-identifier">merge</span>( <span class="ruby-identifier">options</span> )
420
+ 77: <span class="ruby-identifier">input</span>( <span class="ruby-identifier">options</span> )
421
+ 78: <span class="ruby-identifier">auto_complete_field</span>( <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:id</span>], <span class="ruby-identifier">autocomplete_options</span> ) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">autocomplete_options</span>.<span class="ruby-identifier">nil?</span>
422
+ 79: <span class="ruby-keyword kw">end</span>
388
423
  </pre>
389
424
  </div>
390
425
  </div>
@@ -149,7 +149,7 @@ Returns:
149
149
  218: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">javascript_tag</span>( <span class="ruby-identifier">content</span>, <span class="ruby-identifier">options</span> = {} )
150
150
  219: <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:type</span>] = <span class="ruby-value str">&quot;text/javascript&quot;</span>
151
151
  220: <span class="ruby-identifier">script</span>( <span class="ruby-identifier">options</span> ) <span class="ruby-keyword kw">do</span>
152
- 221: <span class="ruby-value str">&quot;//&lt;![CDATA[\n&quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">content</span> <span class="ruby-operator">+</span> <span class="ruby-value str">&quot;\n//]]&gt;&quot;</span>
152
+ 221: <span class="ruby-value str">&quot;//&lt;![CDATA[\n&quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">content</span> <span class="ruby-operator">+</span> <span class="ruby-value str">&quot;\n//]]&gt;\n&quot;</span>
153
153
  222: <span class="ruby-keyword kw">end</span>
154
154
  223: <span class="ruby-keyword kw">end</span>
155
155
  </pre>
data/doc/rdoc/created.rid CHANGED
@@ -1 +1 @@
1
- Wed, 09 Apr 2008 20:08:28 +0200
1
+ Tue, 03 Jun 2008 16:18:13 +0200