views:

63

answers:

0

I have searched a lot, but did not find anything useful, so I just ask. The context is Rails 2.3.x, the usual javascript libraries. I would like to reach the following:

  1. I would like to have something similar to <%= text_field_with_auto_complete :recipe, :name %> but on text editors: <%= text_editor_with_auto_complete :recipe, :description, '\w+\:\w+' %>
  2. It should be customizable (best by a reg-expression) when to start auto-complete. So instead of starting for the whole contents, I would like to start on \w+\:\w+ which means: start calling auto-complete when a string is entered that starts with non-space characters followed by a ':' sign which is followed by non-space characters.
  3. The replacement should be done only on the string that matches the reg-expression of course.

Do you know any solution that could be adapted to my needs?