Skip to content

Commit

Permalink
revisi code again
Browse files Browse the repository at this point in the history
  • Loading branch information
varid007 committed May 4, 2012
1 parent 19266c0 commit a8c3c04
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 5 deletions.
14 changes: 12 additions & 2 deletions belajar/app/views/articles/edit.html.erb
Original file line number Diff line number Diff line change
@@ -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| %>
Expand All @@ -20,3 +26,7 @@
<%= f.submit "Submit" %>
<%= link_to "Back to Index",articles_path%>
<% end %>

</body>

</html>
7 changes: 7 additions & 0 deletions belajar/app/views/articles/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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/>
Expand All @@ -14,3 +20,4 @@
</body>

</html>

6 changes: 3 additions & 3 deletions belajar/app/views/articles/show.html.erb
Original file line number Diff line number Diff line change
@@ -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.