How to do a Sequel query with 'like'?

I'm trying to implement a form to search through the title of my posts.

This is the controller code:

post '/search'  do
@results = Post.all( => "%#{params[:query]}%")
erb :layout 

This is the layout.erb code:

<form action="/search" method="post">
 <input type="text" name="query"/><br />   
 <input type="submit" />
<% if @results %>
  <%@results.each do |r|%>
  <tr valign="top">
<% end %>

I get an error saying 'undefined method `like' for :Title:Symbol'

Any idea please?



@results = DB[:posts].where(, "%#{params[:query]}%"))

Need Your Help

Error While Installing IIS 6 Metabase and IIS 6 Configuration Compatibility

windows-7 iis-6

While I'm installing the IIS 6 Metabase and IIS 6 Configuration Compatibility, I got an error as below, Please any one have idea about it?

blueprint of blueprints (Flask)

python web-services web-applications flask blueprint

I have a series of blueprints I'm using, and I want to be able to bundle them further into a package I can use as seamlessly as possible with any number of other applications. A bundle of blueprint...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.