I want to incorporate an autocompleter field in the create and update
screens of my ActiveScaffold routine. What is the best way of
accomplishing this? Do we need to define a partial field override?
Thanks
To summarise, I have an ActiveScaffold component called Worksheets
(worksheets_controller). The field that I want the autocomplete to be
called on is called product_description, so I created a partial
called: /app/view/worksheets/_product_description_form_column.rhtml
within this file, I have:-
<% text_field_with_auto_complete, :product, :description -%>
Also, within the controller, I have:
auto_complete_for :product, :description
Every time I hit the 'Create' button, nothing happens. Where am I
going wrong?
On Apr 17, 3:31 am, "Lance Ivy" <l...@cainlevy.net> wrote:
> Yep, I think you want a form override. You might find some tips by searching
> this Google Group for "autocomplete" ... I've seen some other posts on the
> topic.
>
<div style="{height: 100px;}">
<label for="@record[:identity_type]">Identity Type</label>
<%= text_field_tag 'record[identity_type]', @record[:identity_type]%>
<div class="auto_complete" id="identity_type_autocomplete_<%=@record
[:id]%>" style="{height: 80px;}"></div>
<%= javascript_tag("new Autocompleter.Local('record[identity_type]',
'identity_type_autocomplete_#{@record[:id]}', ['User', 'Group',
'AdminUser'], {fullSearch: true, frequency: 0, minChars: 1});") -%>
</div>
In this case the set of options was small and so I used the
javascript version of autocomplete rather than the server based one.
Michael
> --~--~---------~--~----~------------~-------~--~----~
> You received this message because you are subscribed to the Google
> Groups "ActiveScaffold : Ruby on Rails plugin" group.
> To post to this group, send email to actives...@googlegroups.com
> To unsubscribe from this group, send email to activescaffold-
> unsub...@googlegroups.com
> For more options, visit this group at http://groups.google.com/
> group/activescaffold?hl=en
> -~----------~----~----~----~------~----~------~--~---
>