public
Description: A Ruby web application framework
Homepage: http://www.mackframework.com
Clone URL: git://github.com/markbates/mack.git
Click here to lend your support to: mack and make a donation at www.pledgie.com !
Fixed form method to take action as the first parameter.
markbates (author)
Thu May 01 14:14:01 -0700 2008
commit  668ce481e0281f37e3cd9d2683931fedf1e53875
tree    30b04daf58f2fd5350c4dd9fed608f847cb4b855
parent  97489502ccccee27f7077eae554e80f49e5b0022
...
12
13
14
15
 
16
17
18
19
20
21
22
 
 
 
23
24
25
26
27
28
 
...
12
13
14
 
15
16
17
18
19
 
 
 
20
21
22
23
24
25
26
27
 
28
0
@@ -12,17 +12,17 @@ app = ARGV[0]
0
 raise "You must specify a name for this application!" if app.nil?
0
 
0
 options = OpenStruct.new
0
-options.orm = "data_mapper"
0
+# options.orm = "data_mapper"
0
 options.version = "0.4.7.100"
0
 
0
 opts = OptionParser.new do |opts|
0
   
0
- opts.on("-o [ORM]") do |v|
0
- options.orm = v
0
- end
0
+ # opts.on("-o [ORM]") do |v|
0
+ # options.orm = v
0
+ # end
0
   
0
 end
0
 
0
 opts.parse!(ARGV)
0
 
0
-MackApplicationGenerator.run({"orm" => options.orm, "version" => options.version, "app" => app})
0
+MackApplicationGenerator.run({"version" => options.version, "app" => app})
...
99
100
101
102
103
 
 
104
105
106
...
99
100
101
 
 
102
103
104
105
106
0
@@ -99,8 +99,8 @@ module Mack
0
         "<link rel=\"alternate\" type=\"application/rss+xml\" title=\"RSS\" href=\"#{url}\">"
0
       end
0
       
0
- def form(options = {}, &block)
0
- options = {:method => :post}.merge(options)
0
+ def form(action, options = {}, &block)
0
+ options = {:method => :post, :action => action}.merge(options)
0
         if options[:id]
0
           options = {:class => options[:id]}.merge(options)
0
         end
...
64
65
66
67
 
68
69
70
71
72
73
 
74
75
76
77
78
79
 
80
81
82
83
84
85
86
 
87
88
89
90
91
92
 
93
94
95
...
64
65
66
 
67
68
69
70
71
72
 
73
74
75
76
77
78
 
79
80
81
82
83
84
85
 
86
87
88
89
90
91
 
92
93
94
95
0
@@ -64,32 +64,32 @@ class HtmlHelpersTest < Test::Unit::TestCase
0
   
0
   def test_form
0
     tmp = <<-EOF
0
-<% form(:action => "http://www.mackframework.com") do %>
0
+<% form("http://www.mackframework.com") do %>
0
 Hello
0
 <% end %>
0
     EOF
0
     assert_equal "<form action=\"http://www.mackframework.com\" method=\"post\">\nHello\n</form>", erb(tmp)
0
     tmp = <<-EOF
0
-<% form(:action => "http://www.mackframework.com", :multipart => true) do %>
0
+<% form("http://www.mackframework.com", :multipart => true) do %>
0
 Hello
0
 <% end %>
0
     EOF
0
     assert_equal "<form action=\"http://www.mackframework.com\" enctype=\"multipart/form-data\" method=\"post\">\nHello\n</form>", erb(tmp)
0
     tmp = <<-EOF
0
-<% form(:action => "http://www.mackframework.com", :id => "my_form") do %>
0
+<% form("http://www.mackframework.com", :id => "my_form") do %>
0
 Hello
0
 <% end %>
0
     EOF
0
     assert_equal "<form action=\"http://www.mackframework.com\" class=\"my_form\" id=\"my_form\" method=\"post\">\nHello\n</form>", erb(tmp)
0
     
0
     tmp = <<-EOF
0
-<% form(:action => "http://www.mackframework.com", :id => "my_form", :method => :get) do %>
0
+<% form("http://www.mackframework.com", :id => "my_form", :method => :get) do %>
0
 Hello
0
 <% end %>
0
     EOF
0
     assert_equal "<form action=\"http://www.mackframework.com\" class=\"my_form\" id=\"my_form\" method=\"get\">\nHello\n</form>", erb(tmp)
0
     tmp = <<-EOF
0
-<% form(:action => "http://www.mackframework.com", :id => "my_form", :method => :put) do %>
0
+<% form("http://www.mackframework.com", :id => "my_form", :method => :put) do %>
0
 Hello
0
 <% end %>
0
     EOF

Comments

    No one has commented yet.