Commit eb10b366 by tady

created show page

parent 05a96506
...@@ -9,7 +9,7 @@ class PostsController < ApplicationController ...@@ -9,7 +9,7 @@ class PostsController < ApplicationController
def show_fragment def show_fragment
@post = Post.find(params[:id]) @post = Post.find(params[:id])
render layout: false render layout: false, partial: 'posts/show_fragment'
end end
# GET /posts # GET /posts
......
<div class="text-box title" style="position:relative;"> <div class="text-box title" style="position:relative;">
<%= @post.title %> <a href="<%= post_path(@post) %>"><%= @post.title %></a>
<a href="<%= edit_post_path(@post) %>" class="btn btn-primary navbar-btn" style="position:absolute;right:0;top:0;margin-top:2px;margin-top:3px;margin-right:3px;"> <a href="<%= edit_post_path(@post) %>" class="btn btn-primary navbar-btn" style="position:absolute;right:0;top:0;margin-top:2px;margin-top:3px;margin-right:3px;">
<span class="glyphicon glyphicon-pencil"></span> <span class="glyphicon glyphicon-pencil"></span>
</a> </a>
......
<p id="notice"><%= notice %></p>
<p> <div class="app">
<strong>Title:</strong>
<%= @post.title %>
</p>
<p> <%= render partial: 'partials/app_header' %>
<strong>Body:</strong>
<%= @post.body %>
</p>
<%= link_to 'Edit', edit_post_path(@post) %> | <div class="container">
<%= link_to 'Back', posts_path %>
<div class="row">
<div class="col-xs-9 col-md-9" id="sidebar" role="navigation">
<div id="xxxxxxxx">
<%= render partial: 'posts/show_fragment' %>
</div>
</div><!--/span-->
<div class="col-xs-12 col-sm-3 col-md-9">
</div><!--/span-->
</div><!--/row-->
<hr>
<footer>
</footer>
</div><!--/.container-->
</div>
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