Changeset 62
- Timestamp:
- 12/07/04 11:43:21 (4 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/actionpack/CHANGELOG
r58 r62 1 1 *SVN* 2 3 * Added that ActiveRecordHelper#form now calls url_for on the :action option. 2 4 3 5 * Added all the HTTP methods as alternatives to the generic "process" for functional testing #276 [Tobias Luetke]. Examples: trunk/actionpack/lib/action_controller/templates/scaffolds/edit.rhtml
r4 r62 1 1 <h1>Editing <%= @scaffold_singular_name %></h1> 2 2 3 <%= form(@scaffold_singular_name, :action => " ../update" + @scaffold_suffix) %>3 <%= form(@scaffold_singular_name, :action => "update" + @scaffold_suffix) %> 4 4 5 5 <%= link_to "Show", :action => "show#{@scaffold_suffix}", :id => instance_variable_get("@#{@scaffold_singular_name}").id %> | trunk/actionpack/lib/action_view/helpers/active_record_helper.rb
r41 r62 25 25 # (post is a new record that has a title using VARCHAR and a body using TEXT): 26 26 # form("post") => 27 # <form action=' create' method='POST'>27 # <form action='/post/create' method='POST'> 28 28 # <p> 29 29 # <label for="post_title">Title</label><br /> … … 45 45 # Proc.new { |record, column| "#{column.human_name}: #{input(record, column.name)}<br />" }) => 46 46 # 47 # <form action=' sign' method='POST'>47 # <form action='/post/sign' method='POST'> 48 48 # Message: 49 49 # <input id="post_title" name="post[title]" size="30" type="text" value="Hello World" /><br /> … … 52 52 def form(record_name, options = {}) 53 53 record = instance_eval("@#{record_name}") 54 action = options[:action] || (record.new_record? ? "create" : "update")54 action = url_for(:action => options[:action] || (record.new_record? ? "create" : "update")) 55 55 id_field = record.new_record? ? "" : InstanceTag.new(record_name, "id", self).to_input_field_tag("hidden") 56 56