resubmitted lab

parent dce0e7c3
...@@ -5,6 +5,15 @@ ...@@ -5,6 +5,15 @@
<hr> <hr>
<%= link_to "View Posts", posts_path %> <%= link_to "View Posts", posts_path %>
<%= link_to "Edit Posts", admin_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> <hr>
<% @categories.each do |c| %> <% @categories.each do |c| %>
<h2>(<%= c.id %>) <%= c.name %></h2> <h2>(<%= c.id %>) <%= c.name %></h2>
...@@ -15,11 +24,4 @@ ...@@ -15,11 +24,4 @@
</ul> </ul>
<%= link_to "View all Posts", "/categories/#{c.id}" %> <%= link_to "View all Posts", "/categories/#{c.id}" %>
<% end %> <% 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> <h1><%= @post.title %></h1>
<h3><%= @post.published_at %></h3> <h3><%= @post.published_at %></h3><p>
<h4>by <%= current_user.email %> </h4>
<p>
<%= @post.content %> <%= @post.content %>
</p> </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> <hr>
<%= link_to "Back to Posts", posts_path %> <%= 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