diff options
| author | David Heinemeier Hansson <david@loudthinking.com> | 2004-12-07 11:43:21 +0000 | 
|---|---|---|
| committer | David Heinemeier Hansson <david@loudthinking.com> | 2004-12-07 11:43:21 +0000 | 
| commit | 3ee4357b8643c611bbe9eb3a7ce820a5e32cddaa (patch) | |
| tree | 1d6efa4c7559a1016a05779d859357bd138d4abc /actionpack/lib | |
| parent | 63c4e789b50f502bedcfd0a9b6bf231ec97307f5 (diff) | |
| download | rails-3ee4357b8643c611bbe9eb3a7ce820a5e32cddaa.tar.gz rails-3ee4357b8643c611bbe9eb3a7ce820a5e32cddaa.tar.bz2 rails-3ee4357b8643c611bbe9eb3a7ce820a5e32cddaa.zip  | |
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
Diffstat (limited to 'actionpack/lib')
| -rw-r--r-- | actionpack/lib/action_controller/templates/scaffolds/edit.rhtml | 2 | ||||
| -rw-r--r-- | actionpack/lib/action_view/helpers/active_record_helper.rb | 6 | 
2 files changed, 4 insertions, 4 deletions
diff --git a/actionpack/lib/action_controller/templates/scaffolds/edit.rhtml b/actionpack/lib/action_controller/templates/scaffolds/edit.rhtml index 1c7f4d9770..d877ea1fd6 100644 --- a/actionpack/lib/action_controller/templates/scaffolds/edit.rhtml +++ b/actionpack/lib/action_controller/templates/scaffolds/edit.rhtml @@ -1,6 +1,6 @@  <h1>Editing <%= @scaffold_singular_name %></h1> -<%= form(@scaffold_singular_name, :action => "../update" + @scaffold_suffix) %> +<%= form(@scaffold_singular_name, :action => "update" + @scaffold_suffix) %>  <%= link_to "Show", :action => "show#{@scaffold_suffix}", :id => instance_variable_get("@#{@scaffold_singular_name}").id %> |  <%= link_to "Back", :action => "list#{@scaffold_suffix}" %> 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") => -      #     <form action='create' method='POST'> +      #     <form action='/post/create' method='POST'>        #       <p>        #         <label for="post_title">Title</label><br />        #         <input id="post_title" name="post[title]" size="30" type="text" value="Hello World" /> @@ -44,14 +44,14 @@ module ActionView        #   form("entry", :action => "sign", :input_block =>         #        Proc.new { |record, column| "#{column.human_name}: #{input(record, column.name)}<br />" }) =>        # -      #     <form action='sign' method='POST'> +      #     <form action='/post/sign' method='POST'>        #       Message:        #       <input id="post_title" name="post[title]" size="30" type="text" value="Hello World" /><br />        #       <input type='submit' value='Sign' />        #     </form>        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")          "<form action='#{action}' method='POST'>" +  | 
