aboutsummaryrefslogtreecommitdiffstats
path: root/railties/guides/source/form_helpers.textile
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2011-07-23 12:15:41 +0200
committerXavier Noria <fxn@hashref.com>2011-07-23 12:15:41 +0200
commitace3723d2fcb1a96d51c2c82050594129328d7c0 (patch)
treed95d16b7dfee13037987913ed71d1708b5484f15 /railties/guides/source/form_helpers.textile
parent94978b9a46173b875bcb0d5cb724e5119e4aa8f4 (diff)
parent38310ab1a6f559860e25b0e28bef9560bb452ae6 (diff)
downloadrails-ace3723d2fcb1a96d51c2c82050594129328d7c0.tar.gz
rails-ace3723d2fcb1a96d51c2c82050594129328d7c0.tar.bz2
rails-ace3723d2fcb1a96d51c2c82050594129328d7c0.zip
Merge branch 'master' of git://github.com/lifo/docrails
Diffstat (limited to 'railties/guides/source/form_helpers.textile')
-rw-r--r--railties/guides/source/form_helpers.textile15
1 files changed, 11 insertions, 4 deletions
diff --git a/railties/guides/source/form_helpers.textile b/railties/guides/source/form_helpers.textile
index 9051ede9dd..96a52af612 100644
--- a/railties/guides/source/form_helpers.textile
+++ b/railties/guides/source/form_helpers.textile
@@ -170,27 +170,34 @@ IMPORTANT: Always use labels for each checkbox and radio button. They associate
h4. Other Helpers of Interest
-Other form controls worth mentioning are the text area, password input and hidden input:
+Other form controls worth mentioning are the text area, password input, hidden input, search input, tel input, url input and email input:
<erb>
<%= text_area_tag(:message, "Hi, nice site", :size => "24x6") %>
<%= password_field_tag(:password) %>
<%= hidden_field_tag(:parent_id, "5") %>
+<%= search_field(:user, :name) %>
+<%= telephone_field(:user, :phone) %>
+<%= url_field(:user, :homepage) %>
+<%= email_field(:user, :address) %>
</erb>
-output:
+Output:
<html>
<textarea id="message" name="message" cols="24" rows="6">Hi, nice site</textarea>
<input id="password" name="password" type="password" />
<input id="parent_id" name="parent_id" type="hidden" value="5" />
+<input id="user_name" name="user[name]" size="30" type="search" />
+<input id="user_phone" name="user[phone]" size="30" type="tel" />
+<input id="user_homepage" size="30" name="user[homepage]" type="url" />
+<input id="user_address" size="30" name="user[address]" type="email" />
</html>
-Hidden inputs are not shown to the user, but they hold data like any textual input. Values inside them can be changed with JavaScript.
+Hidden inputs are not shown to the user, but they hold data like any textual input. Values inside them can be changed with JavaScript. The search, tel, url and email inputs are specified in HTML5 and may receive special handling and/or formatting in some user-agents.
TIP: If you're using password input fields (for any purpose), you might want to configure your application to prevent those parameters from being logged.
-
h3. Dealing with Model Objects
h4. Model Object Helpers