Skip to content

Instantly share code, notes, and snippets.

@karuna24s
Last active October 24, 2016 04:38
Show Gist options
  • Save karuna24s/b9baf09f54cf36d11ff245fe24f45d5b to your computer and use it in GitHub Desktop.
Save karuna24s/b9baf09f54cf36d11ff245fe24f45d5b to your computer and use it in GitHub Desktop.
<div class="container">
<div class=" well col-sm-6">
<%= render 'shared/error_messages' %>
<h3>Food Travel Story</h3>
<p>Title: <%=@destination.title%></p>
<p>Written by: <%= @destination.user.name %></p>
<p>Location: <%=@destination.location%></p>
<p>Name: <%=@food.name%></p>
<p>Type of Food: <%=@food.category%></p>
<p>Content: <%=@destination.content%></p>
<p>Recommendations: <%=@destination.recommendation%></p><br>
<%= link_to "Update Food Travel Story", edit_destination_path(@destination), class: "btn btn-info btn-sm dest_button" %><br><br>
<%= link_to "Delete Food Travel Story", [@destination], method: :delete, data: { confirm: 'Are you sure?' }, class: "btn btn-warning btn-sm dest_button" %><br><br>
<% if current_user %>
<h4>Add a comment:</h4>
<%= form_for @comment, url: destination_comments_path(@destination, @comment) do |f| %>
<p><strong>Content</strong> <%= f.text_area :content, class: 'form-control' %></p>
<%= f.submit "Create Comment", class: "btn btn-sm btn-primary" %>
<% end %><br>
<% else %>
<p>Please log in order to add a comment.</p>
<% end %>
<h4>Comments:</h4>
<% @destination.comments.each do |comment| %>
<div class="well well-white">
<strong><%= comment.user.name %></strong> says: <%= comment.content %>
</div>
<% end %>
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment