Skip to content
Browse files

Dont repeat error messages in scaffolds

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@962 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent d06239e commit 7d09215506503354f5bdea48544e5f07a4376efa @dhh dhh committed Mar 21, 2005
View
5 railties/lib/rails_generator/generators/components/scaffold/templates/view_edit.rhtml
@@ -1,11 +1,8 @@
<h1>Editing <%= singular_name %></h1>
-<%%= error_messages_for '<%= singular_name %>' %>
-
<%%= start_form_tag :action => 'update<%= @suffix %>', :id => @<%= singular_name %> %>
<%%= render_partial "form" %>
-
- <input type="submit" value="Edit" />
+ <%%= submit_tag "Edit" %>
<%%= end_form_tag %>
<%%= link_to 'Show', :action => 'show<%= suffix %>', :id => @<%= singular_name %> %> |
View
5 railties/lib/rails_generator/generators/components/scaffold/templates/view_new.rhtml
@@ -1,11 +1,8 @@
<h1>New <%= singular_name %></h1>
-<%%= error_messages_for '<%= singular_name %>' %>
-
<%%= start_form_tag :action => 'create<%= @suffix %>' %>
<%%= render_partial "form" %>
-
- <input type="submit" value="Create" />
+ <%%= submit_tag "Create" %>
<%%= end_form_tag %>
<%%= link_to 'Back', :action => 'list<%= suffix %>' %>
View
2 railties/lib/rails_generator/generators/components/scaffold/templates/view_show.rhtml
@@ -1,6 +1,6 @@
<%% for column in <%= model_name %>.content_columns %>
<p>
- <b><%%= column.human_name %>:</b> <%%= @<%= singular_name %>.send(column.name) %>
+ <b><%%= column.human_name %>:</b> <%%=h @<%= singular_name %>.send(column.name) %>
</p>
<%% end %>

0 comments on commit 7d09215

Please sign in to comment.
Something went wrong with that request. Please try again.