aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2004-12-12 14:14:37 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2004-12-12 14:14:37 +0000
commitb141bdbb32cb58e493e6f52e4f1baa2a9d28680d (patch)
tree965a345f20bc725a42a1d95396b1f117229f572e
parent19c62a7ee917676674e01f24ce39e59d4f8c7aa2 (diff)
downloadrails-b141bdbb32cb58e493e6f52e4f1baa2a9d28680d.tar.gz
rails-b141bdbb32cb58e493e6f52e4f1baa2a9d28680d.tar.bz2
rails-b141bdbb32cb58e493e6f52e4f1baa2a9d28680d.zip
Display error messages on scaffolded form pages
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@124 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-rw-r--r--actionpack/lib/action_controller/templates/scaffolds/edit.rhtml1
-rw-r--r--actionpack/lib/action_controller/templates/scaffolds/new.rhtml1
-rw-r--r--railties/generators/scaffold/templates/view_edit.rhtml1
-rw-r--r--railties/generators/scaffold/templates/view_new.rhtml1
4 files changed, 4 insertions, 0 deletions
diff --git a/actionpack/lib/action_controller/templates/scaffolds/edit.rhtml b/actionpack/lib/action_controller/templates/scaffolds/edit.rhtml
index d877ea1fd6..31e15f7501 100644
--- a/actionpack/lib/action_controller/templates/scaffolds/edit.rhtml
+++ b/actionpack/lib/action_controller/templates/scaffolds/edit.rhtml
@@ -1,5 +1,6 @@
<h1>Editing <%= @scaffold_singular_name %></h1>
+<%= error_messages_for(@scaffold_singular_name) %>
<%= form(@scaffold_singular_name, :action => "update" + @scaffold_suffix) %>
<%= link_to "Show", :action => "show#{@scaffold_suffix}", :id => instance_variable_get("@#{@scaffold_singular_name}").id %> |
diff --git a/actionpack/lib/action_controller/templates/scaffolds/new.rhtml b/actionpack/lib/action_controller/templates/scaffolds/new.rhtml
index 02f52e72f5..74db8468bd 100644
--- a/actionpack/lib/action_controller/templates/scaffolds/new.rhtml
+++ b/actionpack/lib/action_controller/templates/scaffolds/new.rhtml
@@ -1,5 +1,6 @@
<h1>New <%= @scaffold_singular_name %></h1>
+<%= error_messages_for(@scaffold_singular_name) %>
<%= form(@scaffold_singular_name, :action => "create" + @scaffold_suffix) %>
<%= link_to "Back", :action => "list#{@scaffold_suffix}" %> \ No newline at end of file
diff --git a/railties/generators/scaffold/templates/view_edit.rhtml b/railties/generators/scaffold/templates/view_edit.rhtml
index fec09e2cbe..260b0ebda1 100644
--- a/railties/generators/scaffold/templates/view_edit.rhtml
+++ b/railties/generators/scaffold/templates/view_edit.rhtml
@@ -1,5 +1,6 @@
<h1>Editing <%= singular_name %></h1>
+<%%= error_messages_for '<%= singular_name %>' %>
<%%= form '<%= singular_name %>', :action => 'update<%= suffix %>' %>
<%%= link_to 'Show', :action => 'show<%= suffix %>', :id => @<%= singular_name %>.id %> |
diff --git a/railties/generators/scaffold/templates/view_new.rhtml b/railties/generators/scaffold/templates/view_new.rhtml
index 840bb02775..df68c1abbf 100644
--- a/railties/generators/scaffold/templates/view_new.rhtml
+++ b/railties/generators/scaffold/templates/view_new.rhtml
@@ -1,5 +1,6 @@
<h1>New <%= @singular_name %></h1>
+<%%= error_messages_for '<%= singular_name %>' %>
<%%= form '<%= singular_name %>', :action => 'create<%= suffix %>' %>
<%%= link_to 'Back', :action => 'list<%= suffix %>' %>