This inspired me to tinker around with the autocomplete problem I
recently described in a Hobo Cookbook question, even though I know
just enough Ruby and Hobo to be dangerous. I found I could get
autocomplete working in "New" pages by changing the <name-one> tag in
rapid_forms.dryml to what follows. However, I can't really explain
why this works, and it may cause other problems. The lines I added or
changed are the ones with the variable 't'.
<def tag="name-one" attrs="complete-target, completer"><%
complete_target ||= this_field_reflection.klass
completer ||= (complete_target.is_a?(Class) ? complete_target :
complete_target.class).name_attribute
t = typed_id(complete_target)
t = complete_target.class.to_s.strip if t == 'this'
%>
<input type="text" name="#{param_name_for_this}"
class="autocompleter #{type_and_field.dasherize} #
{css_data :complete_on, t, completer}"
value="&name :no_wrapper => true, :if_present => true"
merge-attrs/>
<div class="completions-popup" style="display:none"></div>
</def>