Skip to content

Commit

Permalink
Show real search results
Browse files Browse the repository at this point in the history
  • Loading branch information
dgoodlad committed Nov 18, 2010
1 parent f673bf8 commit 33d0a47
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions app/_attachments/coffee/app.coffee
Expand Up @@ -15,16 +15,14 @@ class PostView extends Backbone.View
class SearchResultSet extends Backbone.Collection
model: Post

fakeResults:
'foo': [ { title: "Foo", body: "Foo" } ]
'bar': [ { title: "Bar", body: "Bar" } ]
parse: (resp) ->
row.doc for row in resp.rows

search: (query, options) ->
@query = query
@url = "/search/#{query}"
@url = "../../_fti/_design/app/ranked_posts?q=#{query}&include_docs=true"
this.trigger 'query', query
this.refresh(@fakeResults[query] || [])
#this.fetch()
this.fetch()

window.SearchResults = new SearchResultSet

Expand Down Expand Up @@ -71,8 +69,8 @@ class PostView extends Backbone.View
className: 'post'

template: '''
<h1>{{title}}</h1>
{{body}}
<h1>{{Title}}</h1>
{{{Body}}}
'''

render: ->
Expand Down

0 comments on commit 33d0a47

Please sign in to comment.