From fad3229cca5d31670f1c1d99542f3d563e226d99 Mon Sep 17 00:00:00 2001 From: mr Date: Fri, 23 Sep 2011 10:34:34 +0200 Subject: endpoint selection for create model form --- helper.rb | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) (limited to 'helper.rb') diff --git a/helper.rb b/helper.rb index 9b47142..234d612 100644 --- a/helper.rb +++ b/helper.rb @@ -108,12 +108,39 @@ helpers do File.unlink(tmpfile) end end - result = OpenTox::Ontology::Echa.endpoint_option_list() + result = endpoint_selection() if result.lines.count > 3 f = File.new(tmpfile,"w") f.print result f.close end - return result + result end -end + + def endpoint_level(endpoint="Endpoints", level=1) + results = OpenTox::Ontology::Echa.echa_endpoints(endpoint) rescue results = [] + out = "" + out += "\n" if results.size > 0 + return out + end + + def endpoint_selection() + out = " \n +
\n" + out += "Please select:\n" + out += endpoint_level + js = "" + out += "
\n" + return out + end + +end \ No newline at end of file -- cgit v1.2.3