From 3ee4357b8643c611bbe9eb3a7ce820a5e32cddaa Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Tue, 7 Dec 2004 11:43:21 +0000 Subject: Added that ActiveRecordHelper#form now calls url_for on the :action option. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@62 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/lib/action_view/helpers/active_record_helper.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'actionpack/lib/action_view/helpers/active_record_helper.rb') diff --git a/actionpack/lib/action_view/helpers/active_record_helper.rb b/actionpack/lib/action_view/helpers/active_record_helper.rb index de18696992..7066121c28 100644 --- a/actionpack/lib/action_view/helpers/active_record_helper.rb +++ b/actionpack/lib/action_view/helpers/active_record_helper.rb @@ -24,7 +24,7 @@ module ActionView # Returns an entire form with input tags and everything for a specified Active Record object. Example # (post is a new record that has a title using VARCHAR and a body using TEXT): # form("post") => - #
+ # #

#
# @@ -44,14 +44,14 @@ module ActionView # form("entry", :action => "sign", :input_block => # Proc.new { |record, column| "#{column.human_name}: #{input(record, column.name)}
" }) => # - # + # # Message: #
# #

def form(record_name, options = {}) record = instance_eval("@#{record_name}") - action = options[:action] || (record.new_record? ? "create" : "update") + action = url_for(:action => options[:action] || (record.new_record? ? "create" : "update")) id_field = record.new_record? ? "" : InstanceTag.new(record_name, "id", self).to_input_field_tag("hidden") "
" + -- cgit v1.2.3