Commit 1440af8c authored by Paulo Macasaet's avatar Paulo Macasaet

blog 144999

parent 91bf72d9
No preview for this file type
class PostsController < ApplicationController
before_filter :authenticate_user!, :except => [:show, :index]
before_action :authenticate_user!
def index
@posts = Post.all
render "posts/index.html.erb"
......
<h1>Admin Blog Posts</h1>
Hello <%= current_user.email %>
<%= link_to("New Post", new_admin_post_path) %>
<table width="100%">
......
<h1>Blog Posts</h1>
Hello <%= current_user.email %>
<table width="100%">
<tr>
<th>Title</th>
......
<h1><%= @post.title %></h1>
<h3><%= @post.published_at %> by <%= current_user.email %></h3>
<h3><%= @post.published_at %> </h3>
<p>
<%= @post.content %>
</p>
......
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