Ruby on rails 具有自动完成功能的就地编辑器
有人能做到这一点吗?可能吗?我正在编写一个Rails 3应用程序,似乎可以使用jquery autocomplete和best-in-place来实现这一点,但我还没有看到它。回复太晚了,但是。。。我刚刚遇到了类似的任务,解决了这个问题:Ruby on rails 具有自动完成功能的就地编辑器,ruby-on-rails,ruby-on-rails-3,jquery-ui,jquery,Ruby On Rails,Ruby On Rails 3,Jquery Ui,Jquery,有人能做到这一点吗?可能吗?我正在编写一个Rails 3应用程序,似乎可以使用jquery autocomplete和best-in-place来实现这一点,但我还没有看到它。回复太晚了,但是。。。我刚刚遇到了类似的任务,解决了这个问题: #view best_in_place @somewhat, :title, type: :input, inner_class: 'somewhat_title', ok_button: 'ok', data: { autocomplete: true
#view
best_in_place @somewhat, :title, type: :input, inner_class: 'somewhat_title',
ok_button: 'ok', data: { autocomplete: true }
#coffee
$("span[data-autocomplete='true']").live 'click', ->
$('.somewhat_title').autocomplete
#usual autocomplete code here, nothing special
我使用了Rails3jQuery自动完成。 在视图中,它将类似于:
best_in_place @object, :name, :type => :input,
html_attrs: { "data-autocomplete" => your_autocomplete_path }