Permalink
Browse files

revisi code again

  • Loading branch information...
1 parent 19266c0 commit a8c3c04bb22bbca0e6eb8e8d4b42568472d69d1a @varid007 committed May 4, 2012
@@ -1,9 +1,15 @@
+<html>
+<head>
+ <title>Ruby On Rails</title>
+</head>
+
+<body>
<%= form_for @article do |f| %>
<% if @article.errors.any? %>
- <div id="errorExplanation">
+ <div >
<h2>
- <%= pluralize(@article.errors.count, "error") %> Please title or body was Error:
+ <%= pluralize(@article.errors.count, "error") %> title or body was Error:
</h2>
<ul>
<% @article.errors.full_messages.each do |msg| %>
@@ -20,3 +26,7 @@
<%= f.submit "Submit" %>
<%= link_to "Back to Index",articles_path%>
<% end %>
+
+</body>
+
+</html>
@@ -5,6 +5,12 @@
<body>
<%= form_for @article do |f| %>
+ <% if @article.errors.any? %>
+ <%= pluralize(@article.errors.count, "Error") %>
+ <% @article.errors.full_messages.each do |msg| %>
+ <%= msg%>
+ <% end %>
+ <% end %>
Title : <br/><%= f.text_field :title %> <br/>
Article :<br/> <%= f.text_area :body %><br/>
Rating : <%= f.text_field :rating %><br/>
@@ -14,3 +20,4 @@
</body>
</html>
+
@@ -1,8 +1,8 @@
<html>
<body>
-<%= @article.title %>
-<%= @article.body %>
-<%= @article.rating %>
+Title : <%= @article.title %><br/>
+Body : <%= @article.body %><br/>
+Rating : <%= @article.rating %><br/>
<%= link_to "back",articles_path %>
</body>
</html>

0 comments on commit a8c3c04

Please sign in to comment.