Skip to content

Commit

Permalink
Mejora de vistas para añadir comentarios
Browse files Browse the repository at this point in the history
  • Loading branch information
Marina González committed Apr 13, 2012
1 parent 32ad377 commit 5de9dd8
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 8 deletions.
6 changes: 6 additions & 0 deletions app/views/comments/_comment.html.erb
@@ -1,3 +1,9 @@
<p>
<%= comment.coment %>
</p>

<p>
<%= link_to 'Destroy Comment', [comment.site, comment],
:confirm => 'Are you sure?',
:method => :delete %>
</p>
7 changes: 7 additions & 0 deletions app/views/comments/_comment.html.erb~
@@ -0,0 +1,7 @@


<p>
<%= link_to 'Destroy Comment', [comment.site, comment],
:confirm => 'Are you sure?',
:method => :delete %>
</p>
1 change: 0 additions & 1 deletion app/views/comments/_form.html.erb
@@ -1,6 +1,5 @@
<%= form_for([@site, @site.comments.build]) do |f| %>
<div class="field">
<%= f.label :coment %><br />
<%= f.text_area :coment %>
</div>

Expand Down
10 changes: 10 additions & 0 deletions app/views/comments/_form.html.erb~
@@ -0,0 +1,10 @@
<%= form_for([@site, @site.comments.build]) do |f| %>
<div class="field">
<%= f.label :coment %><br />
<%= f.text_area :coment %>
</div>

<div class="actions">
<%= f.submit %>
</div>
<% end %>
9 changes: 5 additions & 4 deletions app/views/sites/show.html.erb
Expand Up @@ -12,11 +12,12 @@

</div>

<b>Comentarios</b>
<%= render @site.comments %>
<b>Comentarios:</b>
<%= render @site.comments %></p

<b>Añada su comentario:</b>
<%= render "comments/form" %>
<p><b>Añada su comentario:</b>
<%= render "comments/form" %></p


<p />
<% if @site.user == current_user %>
Expand Down
7 changes: 4 additions & 3 deletions app/views/sites/show.html.erb~
Expand Up @@ -13,10 +13,11 @@
</div>

<b>Comentarios</b>
<%= render @site.comments %>
<%= render @site.comments %></p

<b>Añada su comentario:</b>
<%= render "comments/form" %>
<p><b>Añada su comentario:</b>
<%= render "comments/form" %></p


<p />
<% if @site.user == current_user %>
Expand Down

0 comments on commit 5de9dd8

Please sign in to comment.