Skip to content

Commit

Permalink
started adding artist search
Browse files Browse the repository at this point in the history
  • Loading branch information
markryall committed Jan 9, 2013
1 parent d44278b commit b772ef8
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
6 changes: 6 additions & 0 deletions lib/app.rb
Expand Up @@ -77,6 +77,12 @@
slim :artists, locals: {criteria: criteria, artists: artists, info: info }
end

get '/api/search/artists' do
criteria = params[:criteria]
artists, info = artists_matching criteria
json artists: artists, info: info
end

def change_volume inc
self.volume = self.volume + inc
json percentage: self.volume
Expand Down
9 changes: 9 additions & 0 deletions public/mobile-search-artists.coffee
@@ -0,0 +1,9 @@
$ ->
$('#search-artists-form').submit ->
$.mobile.loading 'show'
$.get '/api/search/artists',
criteria: $('#search-artists-criteria').val(),
(data) ->
$.mobile.loading 'hide'
console.log data
false
13 changes: 12 additions & 1 deletion public/mobile-search-artists.js
@@ -1,5 +1,16 @@
(function() {


$(function() {
return $('#search-artists-form').submit(function() {
$.mobile.loading('show');
$.get('/api/search/artists', {
criteria: $('#search-artists-criteria').val()
}, function(data) {
$.mobile.loading('hide');
return console.log(data);
});
return false;
});
});

}).call(this);

0 comments on commit b772ef8

Please sign in to comment.