diff options
author | Christoph Helma <helma@in-silico.ch> | 2010-07-05 12:22:04 +0200 |
---|---|---|
committer | Christoph Helma <helma@in-silico.ch> | 2010-07-05 12:22:04 +0200 |
commit | 5eec83b4196c84b32817d045d31b0815db38fb05 (patch) | |
tree | 10c90f60e734629f24ff013b162c75315656a4ad | |
parent | 4e7cb403dc2572593a3eef601b14e28a27f2524c (diff) |
javascript regexp fixed
-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"); |