Created
September 30, 2008 06:17
-
-
Save prem/13750 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Minerva | |
module Resources | |
class ParseQuery | |
include Waves::Resources::Mixin | |
include Minerva::Resources::ParseHelper | |
Formats = [ :json, :html ] | |
on( :get, ['parseQuery'], :query => { :searchText => true } ) do | |
ParseHelper.parse_query_term(query) | |
format = File.extname( path ); format = 'json' if format.empty? | |
results.send( "to_#{ format }" ) | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment