Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
use Ha.sh for readability
  • Loading branch information
John Woodell committed Aug 9, 2010
1 parent 1557405 commit 3e5598b
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions 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)
Expand Down Expand Up @@ -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) + "</div>"
end

Expand Down

0 comments on commit 3e5598b

Please sign in to comment.