diff --git a/lib/dubious/form_helper.duby b/lib/dubious/form_helper.duby index 36daaaa..571b079 100644 --- a/lib/dubious/form_helper.duby +++ b/lib/dubious/form_helper.duby @@ -1,11 +1,10 @@ import com.google.appengine.ext.duby.db.Model -import java.lang.StringBuilder import dubious.TimeConversion import dubious.InstanceTag -import java.util.List import java.util.HashMap -import stdlib.Array +import java.util.List import java.util.Date +import stdlib.* class FormHelper def initialize(model:Model, params:Params) @@ -38,15 +37,13 @@ class FormHelper end def start_form - method = ["get" ,"post"].contains(@method) ? "" : @t.tag("input", + _method = ["get" ,"post"].contains(@method) ? "" : @t.tag("input", :name => "_method", :type => "hidden", :value => @method) - hm1 = {:action => @action, :method => "post"} - hm1.put('id', "#{@params.action}_#{@kind}") - hm1.put('class', @params.action) - hm2 = HashMap.new; hm2.put('style', "margin:0;padding:0;display:inline") - hm3 = {:name => "authenticity_token", :type => "hidden"} - hm3.put('value', @token) - @t.tag("form", hm1, true) + method + @t.tag("div", hm2, true) + + hm1 = Ha.sh [:action, @action, :id, "#{@params.action}_#{@kind}", + :method, "post", :class, @params.action] + hm2 = Ha.sh [:style, "margin:0;padding:0;display:inline"] + hm3 = Ha.sh [:name, "authenticity_token", :type, "hidden", :value, @token] + @t.tag("form", hm1, true) + _method + @t.tag("div", hm2, true) + @t.tag("input", hm3) + "" end