resubmitted lab

parent dce0e7c3
......@@ -5,6 +5,15 @@
<hr>
<%= link_to "View Posts", posts_path %>
<%= link_to "Edit Posts", admin_posts_path %>
<% else %>
You are not signed in
<hr>
<%= link_to "Login", new_user_session_path %>
or
<%= link_to "Sign Up", new_user_registration_path %>
<% end %>
<hr>
<% @categories.each do |c| %>
<h2>(<%= c.id %>) <%= c.name %></h2>
......@@ -15,11 +24,4 @@
</ul>
<%= link_to "View all Posts", "/categories/#{c.id}" %>
<% end %>
<% else %>
You are not signed in
<hr>
<%= link_to "Login", new_user_session_path %>
or
<%= link_to "Sign Up", new_user_registration_path %>
<% end %>
<% if user_signed_in? %>
<h1><%= @post.title %></h1>
<h3><%= @post.published_at %></h3>
<h4>by <%= current_user.email %> </h4>
<p>
<h3><%= @post.published_at %></h3><p>
<%= @post.content %>
</p>
<h4>by <%= current_user.email %> </h4>
<% else %>
<h1><%= @post.title %></h1>
<h3><%= @post.published_at %></h3><p>
<hr>
<%= link_to "Login", new_user_session_path %>
or
<%= link_to "Sign Up", new_user_registration_path %>
to read blog
<%end%>
<hr>
<%= link_to "Back to Posts", posts_path %>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment