patch for autocomplete

1 view
Skip to first unread message

magi...@gmail.com

unread,
Nov 25, 2008, 6:50:25 PM11/25/08
to Hobo Users
I don't know if this is the right place to post this, so please tell
me if there is a better place, but I fixed the autocompletion on edge
by changing hobo/lib/hobo/controller.rb:83 to be:


renderer = Hobo::Dryml.page_renderer(@template, [], page_path,
@template.finder.pick_template(page_path, "dryml")) if page_path


-Seth

davidh

unread,
Nov 27, 2008, 1:38:00 AM11/27/08
to Hobo Users
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>

Tom Locke

unread,
Nov 27, 2008, 10:07:04 AM11/27/08
to hobo...@googlegroups.com
> This inspired me to tinker around with the autocomplete problem I
> recently described in a Hobo Cookbook question

Can you post a link to the question - I couldn't find it

Tom

Tom Locke

unread,
Nov 27, 2008, 11:03:40 AM11/27/08
to hobo...@googlegroups.com

Thanks for this, but unfortunately finder.pick_template is gone in
Rails 2.2. It was the fixes for 2.2 that introduced this problem. Will
investigate...

Tom

davidh

unread,
Nov 27, 2008, 11:48:54 AM11/27/08
to Hobo Users

Tom Locke

unread,
Nov 27, 2008, 12:50:50 PM11/27/08
to Hobo Users
I just pushed a fix to that problem related to 2.2. On a quick attempt
I wasn't able to replicate your problem, but this fix is needed
anyway.

Tom
Reply all
Reply to author
Forward
0 new messages