Changeset 135
- Timestamp:
- 02/02/07 22:13:22 (2 years ago)
- Files:
-
- trunk/demo/app/models/comment.rb (modified) (1 diff)
- trunk/demo/app/models/remote_content.rb (added)
- trunk/demo/app/views/admin/backend/search.rhtml (modified) (2 diffs)
- trunk/demo/app/views/content/edit.rhtml (modified) (1 diff)
- trunk/demo/app/views/content/new.rhtml (modified) (1 diff)
- trunk/demo/app/views/content/search.rhtml (modified) (2 diffs)
- trunk/demo/db/migrate/006_create_remote_contents.rb (added)
- trunk/demo/test/fixtures/remote_contents.yml (added)
- trunk/demo/test/functional/admin/backend_controller_test.rb (modified) (1 diff)
- trunk/demo/test/unit/content_test.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/demo/app/models/comment.rb
r111 r135 1 1 class Comment < ActiveRecord::Base 2 belongs_to :parent, :class_name => 'Content' 2 belongs_to :parent, :class_name => 'Content', :foreign_key => :parent_id 3 3 4 4 # simplest case: just index all fields of this model: trunk/demo/app/views/admin/backend/search.rhtml
r83 r135 1 1 <h1>Search Content (backend)</h1> 2 <% = form_tag :action => 'search'%>2 <% form_tag :action => 'search' do %> 3 3 <fieldset> 4 4 <legend>Search</legend> … … 6 6 </fieldset> 7 7 <%= submit_tag 'search' %> 8 <% = end_form_tag%>8 <% end %> 9 9 10 10 <% if @results -%> trunk/demo/app/views/content/edit.rhtml
r5 r135 1 1 <h1>Editing content</h1> 2 2 3 <% = start_form_tag :action => 'update', :id => @content%>3 <% form_tag :action => 'update', :id => @content do %> 4 4 <%= render :partial => 'form' %> 5 5 <%= submit_tag 'Edit' %> 6 <% = end_form_tag%>6 <% end %> 7 7 8 8 <%= link_to 'Show', :action => 'show', :id => @content %> | trunk/demo/app/views/content/new.rhtml
r5 r135 1 1 <h1>New content</h1> 2 2 3 <% = start_form_tag :action => 'create'%>3 <% form_tag :action => 'create' do %> 4 4 <%= render :partial => 'form' %> 5 5 <%= submit_tag "Create" %> 6 <% = end_form_tag%>6 <% end %> 7 7 8 8 <%= link_to 'Back', :action => 'list' %> trunk/demo/app/views/content/search.rhtml
r5 r135 1 1 <h1>Search Content</h1> 2 <% = form_tag :action => 'search'%>2 <% form_tag :action => 'search' do %> 3 3 <fieldset> 4 4 <legend>Search</legend> … … 6 6 </fieldset> 7 7 <%= submit_tag 'search' %> 8 <% = end_form_tag%>8 <% end %> 9 9 10 10 <% if @results -%> trunk/demo/test/functional/admin/backend_controller_test.rb
r83 r135 20 20 def test_search 21 21 get :search 22 assert_ success22 assert_response :success 23 23 assert_template 'search' 24 24 assert_nil assigns(:results) trunk/demo/test/unit/content_test.rb
r122 r135 187 187 188 188 def test_multi_index 189 i = FerretMixin::Acts::ARFerret::MultiIndex.new([Content, Comment])189 i = ActsAsFerret::MultiIndex.new([Content, Comment]) 190 190 hits = i.search(TermQuery.new(:title,"title")) 191 191 assert_equal 1, hits.total_hits
