From bbd43f57bce092575e64d9787e1485b56cb56b0f Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Mon, 8 Jul 2019 11:45:10 +1200 Subject: [PATCH] Prevent post images going off screen --- app/assets/stylesheets/application.scss | 1 + app/assets/stylesheets/posts.scss | 5 +++++ app/views/posts/show.html.haml | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 app/assets/stylesheets/posts.scss diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index 818e0f4ca..fc958cd69 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -13,6 +13,7 @@ @import 'members'; @import 'harvests'; @import 'seeds'; +@import 'posts'; @import 'crops'; @import 'homepage'; diff --git a/app/assets/stylesheets/posts.scss b/app/assets/stylesheets/posts.scss new file mode 100644 index 000000000..d13acd845 --- /dev/null +++ b/app/assets/stylesheets/posts.scss @@ -0,0 +1,5 @@ +.post-content { + img { + max-width: 100%; + } +} \ No newline at end of file diff --git a/app/views/posts/show.html.haml b/app/views/posts/show.html.haml index f73a8aecf..34f94da9b 100644 --- a/app/views/posts/show.html.haml +++ b/app/views/posts/show.html.haml @@ -39,7 +39,7 @@ = @post.subject = render 'posts/actions', post: @post .card-body - = render 'posts/single', post: @post + .post-content= render 'posts/single', post: @post .card-footer = render 'posts/likes', post: @post