diff --git a/app/assets/stylesheets/articles.scss b/app/assets/stylesheets/articles.scss index cca5487..b3da7d5 100644 --- a/app/assets/stylesheets/articles.scss +++ b/app/assets/stylesheets/articles.scss @@ -1,3 +1,22 @@ // Place all the styles related to the articles controller here. // They will automatically be included in application.css. // You can use Sass (SCSS) here: http://sass-lang.com/ + +.ArticleWrap { + margin: 0 auto; + padding: 24px; + max-width: 600px; + background: #e6e6e6; + + .ArticleTitle { + text-align: center; + } + + .ArticleContent { + + } + + .ArticleCoverImage { + width: 100%; + } +} \ No newline at end of file diff --git a/app/controllers/articles_controller.rb b/app/controllers/articles_controller.rb index 5c74773..7e530c4 100644 --- a/app/controllers/articles_controller.rb +++ b/app/controllers/articles_controller.rb @@ -10,6 +10,14 @@ def index # GET /articles/1 # GET /articles/1.json def show + # respond_to do |f| + # f.html do + # @is_pdf = false + # end + # f.pdf do + # @is_pdf = true + # end + # end end # GET /articles/new diff --git a/app/views/articles/show.html.erb b/app/views/articles/show.html.erb index 549402e..daa66be 100644 --- a/app/views/articles/show.html.erb +++ b/app/views/articles/show.html.erb @@ -1,19 +1,15 @@ -

<%= notice %>

+
+

<%= @article.title %>

-

- Title: - <%= @article.title %> -

+ <%= image_tag @article.cover_image, class: 'ArticleCoverImage' %> -

- Content: - <%= @article.content %> -

+

+ <%= @article.content %> +

+
-

- Cover: - <%= image_tag @article.cover_image, width: 50, height: 50 %> -

+<% if !@is_pdf %> + <%= link_to 'Edit', edit_article_path(@article) %> | + <%= link_to 'Back', articles_path %> +<% end %> -<%= link_to 'Edit', edit_article_path(@article) %> | -<%= link_to 'Back', articles_path %>