|
|
| 17 |
19 |
|
| 17 | 17 | # |
| 18 | 18 | # When you call <tt>#text_area</tt> for attributes which are not |
| 19 | 19 | # templated, we defer to Rails's original <tt>#text_area</tt> without |
| 20 | | # changes. |
| 20 | # enhhancement. |
| 21 | 21 | # |
| 22 | 22 | # Javascript support will be disabled if <tt>:templated_javascript => |
| 23 | 23 | # false</tt> is passed in the options hash of +text_area+. |
| 24 | 24 | # |
| 25 | 25 | # <b>Note:</b> The Javascript uses Prototype to add event handlers to |
| 26 | 26 | # your form. Make sure <tt>prototype.js</tt> is included in your layout. |
| 27 | # |
| 28 | # Usage: |
| 29 | # <% form_for @user do |form| %> |
| 30 | # <label for="user_website">About you:</label> |
| 31 | # <%= form.text_area :bio %> |
| 32 | # <% end %> |
| 27 | 33 | def text_area_with_templating(class_name, method, options={}) |
| 28 | 34 | args = [class_name, method, options] # use params above for docs' sake |
| 29 | 35 | if templated?(*args) |
| --- | --- | |
| 39 | 45 | # <tt>ActionView::Helpers::FormHelper#text_field</tt> so you can get |
| 40 | 46 | # templated attribute behavior with <tt><input type="text"></tt> tags. |
| 41 | 47 | # See notes for <tt>#text_area_with_templating</tt> above. |
| 48 | # |
| 49 | # Usage: |
| 50 | # <% form_for @user do |form| %> |
| 51 | # <label for="user_website">Website:</label> |
| 52 | # <%= form.text_field :website %> |
| 53 | # |
| 54 | # <label for="user_phone">Phone:</label> |
| 55 | # <%= form.text_field :phone, :templated_javascript => false %> |
| 56 | # <% end %> |
| 42 | 57 | def text_field_with_templating(class_name, method, options={}) |
| 43 | 58 | args = [class_name, method, options] # use params above for docs' sake |
| 44 | 59 | if templated?(*args) |