This file contains hidden or 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
| def search | |
| @posts = Post.find(:all, :conditions => ['title LIKE ?', "#{params[:query]}%"], :order => "title") | |
| results = [:query => "#{params[:query]}"] | |
| suggestions = [] | |
| @posts.each do |x| | |
| suggestions << "#{x.title}" | |
| end | |
| results << {:suggestions => suggestions} | |
| puts results | |
| respond_to do |format| |
This file contains hidden or 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
| def playlist | |
| list = [] | |
| songs = Song.all | |
| songs.each do |s| | |
| list.push([trackinfo => "#{s.artist.name} | #{s.name}", mp3 => "#{s.mp3.url}"]) | |
| end | |
| return list.to_json | |
| end |
NewerOlder