Skip to content

Commit

Permalink
This example seems unnecessary. Note that the examples of form helper…
Browse files Browse the repository at this point in the history
…s depict just their traditional usage. The documentation of form_for is the one that makes the link with form builders. On the other hand, people are expected to know what's a hidden field in HTML forms.
  • Loading branch information
fxn committed Dec 31, 2008
1 parent 3dae667 commit 6260dee
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions actionpack/lib/action_view/helpers/form_helper.rb
Expand Up @@ -390,14 +390,6 @@ def password_field(object_name, method, options = {})
#
# hidden_field(:user, :token)
# # => <input type="hidden" id="user_token" name="user[token]" value="#{@user.token}" />
#
# If you have a form object f that is using an object @client:
# <%= f.hidden_field :user_id, :value => current_user.id %>
# # => <input id="client_user_id" name="client[user_id]" type="hidden" value="12345" />
#
# This passes a hidden variable user_id with the value of current_user.id, it can be accessed in the controller as:
# params[:client][:user_id]

def hidden_field(object_name, method, options = {})
InstanceTag.new(object_name, method, self, options.delete(:object)).to_input_field_tag("hidden", options)
end
Expand Down

0 comments on commit 6260dee

Please sign in to comment.