Any suggestion why im getting this message in my Simple Search ?
** i want to search in multiple rows in my db.
thanks
SyntaxError in PostsController#index
/Users/webstic/Sites/weblog/app/models/post.rb:7: syntax error,
unexpected tCONSTANT, expecting ']'
...onditions => ['body LIKE?' AND 'title LIKE?', "%#{search}%"]...
^
/Users/webstic/Sites/weblog/app/models/post.rb:7: syntax error,
unexpected ']', expecting kEND
... 'title LIKE?', "%#{search}%"], :order => 'created_at DESC'
^
code @ models/posts.rb
def self.search(search, page)
paginate :per_page => 3, :page => page,
:conditions => ['body LIKE?' AND 'title LIKE?',
"%#{search}%"], :order => 'created_at DESC'
end
end
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---