diff options
-rw-r--r-- | application.rb | 10 | ||||
-rw-r--r-- | model.rb | 2 | ||||
-rwxr-xr-x | public/javascripts/toxcreate.js | 2 |
3 files changed, 8 insertions, 6 deletions
diff --git a/application.rb b/application.rb index 3967df5..c18a394 100644 --- a/application.rb +++ b/application.rb @@ -51,9 +51,9 @@ end get '/model/:id/:view/?' do response['Content-Type'] = 'text/plain' model = ToxCreateModel.get(params[:id]) - model.process + model = model.process - #begin + begin case params[:view] when "model" haml :model, :locals=>{:model=>model}, :layout => false @@ -64,9 +64,9 @@ get '/model/:id/:view/?' do else return "render error" end - #rescue - # return "unable to render model" - #end + rescue + return "unable to render model" + end end get '/predict/?' do @@ -136,6 +136,8 @@ class ToxCreateModel end end + self + end DataMapper.auto_upgrade! diff --git a/public/javascripts/toxcreate.js b/public/javascripts/toxcreate.js index cd2efa2..6d593cc 100755 --- a/public/javascripts/toxcreate.js +++ b/public/javascripts/toxcreate.js @@ -68,7 +68,7 @@ $(function() { }, success: function(data) { if (view == "model") $("div#model_" + id).html(data); - if (view ~= /validation/) $("dl#model_validation_" + id).html(data); + if (view.match(/validation/)) $("dl#model_validation_" + id).html(data); }, error: function(data) { //alert("loadModel error"); |