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 !
markbates (author)
Thu Aug 14 12:37:41 -0700 2008
commit  53d126e181ab37c249b472a28201e0b3cf033db8
tree    079bab406c00f24547708fea5cc27cdb1a5a721e
parent  620bd22da9f75b782db693879b8b654bb4587ab2
mack / lib / mack / core_extensions / symbol.rb
100644 83 lines (71 sloc) 3.381 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
class Symbol
  
  # See Mack::ViewHelpers::FormHelpers check_box for more information
  #
  # Examples:
  # @user = User.new(:accepted_tos => true)
  # <%= :user.check_box :accepted_tos %> # => <input checked="checked" id="user_accepted_tos" name="user[accepted_tos]" type="checkbox" />
  # <%= :i_dont_exist.checkbox %> # => <input id="i_dont_exist" name="i_dont_exist" type="checkbox" />
  def check_box(*args)
    Thread.current[:view_template].check_box(self, *args)
  end
  
  # See Mack::ViewHelpers::FormHelpers file_field for more information
  #
  # Examples:
  # @user = User.new(:bio_file => "~/bio.doc")
  # <%= :user.file_field :bio_file %> # => <input id="user_bio_field" name="user[bio_field]" type="file" value="~/bio.doc" />
  # <%= :i_dont_exist.file_field %> # => <input id="i_dont_exist" name="i_dont_exist" type="file" value="" />
  def file_field(*args)
    Thread.current[:view_template].file_field(self, *args)
  end
  
  # See Mack::ViewHelpers::FormHelpers hidden_field for more information
  #
  # Examples:
  # @user = User.new(:email => "mark@mackframework.com")
  # <%= :user.hidden_field :email %> # => <input id="user_email" name="user[email]" type="hidden" value="mark@mackframework.com" />
  # <%= :i_dont_exist.hidden_field %> # => <input id="i_dont_exist" name="i_dont_exist" type="hidden" />
  def hidden_field(*args)
    Thread.current[:view_template].hidden_field(self, *args)
  end
  
  # See Mack::ViewHelpers::FormHelpers image_submit for more information
  def image_submit(*args)
    Thread.current[:view_template].image_submit(self, *args)
  end
  
  # See Mack::ViewHelpers::FormHelpers label_tag for more information
  def label_tag(*args)
    Thread.current[:view_template].label(self, *args)
  end
  
  # See Mack::ViewHelpers::FormHelpers password_field for more information
  #
  # Examples:
  # @user = User.new(:email => "mark@mackframework.com")
  # <%= :user.password_field :email %> # => <input id="user_email" name="user[email]" type="password" value="mark@mackframework.com" />
  # <%= :i_dont_exist.password_field %> # => <input id="i_dont_exist" name="i_dont_exist" type="password" />
  def password_field(*args)
    Thread.current[:view_template].password_field(self, *args)
  end
  
  # See Mack::ViewHelpers::FormHelpers radio_button for more information
  def radio_button(*args)
    Thread.current[:view_template].radio_button(self, *args)
  end
  
  # See Mack::ViewHelpers::FormHelpers select for more information
  def select(*args)
    Thread.current[:view_template].select(self, *args)
  end
  
  # See Mack::ViewHelpers::FormHelpers submit for more information
  def submit(*args)
    Thread.current[:view_template].submit(self, *args)
  end
  
  # See Mack::ViewHelpers::FormHelpers text_area for more information
  def text_area(*args)
    Thread.current[:view_template].text_area(self, *args)
  end
  
  # See Mack::ViewHelpers::FormHelpers text_field for more information
  #
  # Examples:
  # @user = User.new(:email => "mark@mackframework.com")
  # <%= :user.text_field :email %> # => <input id="user_email" name="user[email]" type="text" value="mark@mackframework.com" />
  # <%= :i_dont_exist.text_field %> # => <input id="i_dont_exist" name="i_dont_exist" type="text" />
  def text_field(*args)
    Thread.current[:view_template].text_field(self, *args)
  end
  
end