Skip to content

Commit

Permalink
some refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
xponrails committed Mar 1, 2012
1 parent ca7ec52 commit 68e127e
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 6,352 deletions.
6 changes: 3 additions & 3 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Sunspot Autocomplete - A Ruby on Rails plugin
Sunspot Autocomplete - A Ruby on Rails gem

Copyright (c) 2010 Haitham Mohammad
Copyright (c) 2012 Stefano Mancini <[email protected]>

Dual licensed under the MIT and GPL licenses:
http://www.opensource.org/licenses/mit-license.php
http://www.gnu.org/licenses/gpl.html
http://www.gnu.org/licenses/gpl.html
31 changes: 14 additions & 17 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,9 @@ http://outoftime.github.com/sunspot

== Installation

Download the plugin and place it under vendor/plugins.
gem "sunspot_autocomplete", ">= 0.0.3", :git => "[email protected]:xponrails/sunspot_autocomplete.git"

Run the following rake task to copy the plugin's assets to your public directory. This will copy jquery.js and solr-autocompleter to your public/javascripts.

rake sunspot_autocomplete:copy_assets
Copy the gem's assets to your assets directory.

== Usage

Expand Down Expand Up @@ -64,28 +62,27 @@ To be able to autocomplete/autosuggest a model's attribute, call 'autocomplete'/
end
end

In your view, Add the following script tags (in the given order) to be able to use the view helpers.
In your application.js, Add the following lines.

<script type="text/javascript" src="/javascripts/jquery.js"></script>
<script type="text/javascript" src="/javascripts/solr-autocomplete/ajax-solr/core/Core.js"></script>
<script type="text/javascript" src="/javascripts/solr-autocomplete/ajax-solr/core/AbstractManager.js"></script>
<script type="text/javascript" src="/javascripts/solr-autocomplete/ajax-solr/managers/Manager.jquery.js"></script>
<script type="text/javascript" src="/javascripts/solr-autocomplete/ajax-solr/core/Parameter.js"></script>
<script type="text/javascript" src="/javascripts/solr-autocomplete/ajax-solr/core/ParameterStore.js"></script>
<script type="text/javascript" src="/javascripts/solr-autocomplete/jquery-autocomplete/jquery.autocomplete.js"></script>
//= require solr-autocomplete/ajax-solr/core/Core
//= require solr-autocomplete/ajax-solr/core/AbstractManager
//= require solr-autocomplete/ajax-solr/managers/Manager.jquery
//= require solr-autocomplete/ajax-solr/core/Parameter
//= require solr-autocomplete/ajax-solr/core/ParameterStore
//= require solr-autocomplete/jquery-autocomplete/jquery.autocomplete

Also, add the following stylesheet to use the basic style included. Alternatively, you can override those style rules to force your design's look and feel.
Also, add the following line in your application.css to use the basic style included. Alternatively, you can override those style rules to force your design's look and feel.

<link type="text/css" rel="stylesheet" href="/javascripts/solr-autocomplete/jquery-autocomplete/jquery.autocomplete.css" />
*= require solr-autocomplete/jquery.autocomplete

In your view, to create a text field with autocomplete:

<%=autocomplete_text_field "post", "title", "http://127.0.0.1:8983/solr/", "post_title"%>
<%= autocomplete_text_field "post", "title", "http://127.0.0.1:8983/solr/", "post_title"%>

And to create a text field with autosuggest:

<%=autosuggest_text_field "post", "author", "http://127.0.0.1:8983/solr/", "post_author"%>
<%= autosuggest_text_field "post", "author", "http://127.0.0.1:8983/solr/", "post_author"%>

You can view documentation for more advanced features of the helpers.



91 changes: 0 additions & 91 deletions README.rdoc

This file was deleted.

Loading

0 comments on commit 68e127e

Please sign in to comment.