Skip to content

Commit

Permalink
fix stylelint and rubucop error
Browse files Browse the repository at this point in the history
  • Loading branch information
cherelemma committed Jul 15, 2023
1 parent 33cd046 commit 1dab854
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 6 deletions.
25 changes: 21 additions & 4 deletions app/assets/stylesheets/application.css
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ a {

.post-text {
display: grid;
grid-template-columns: 3fr 1fr;
grid-template-columns: 2fr 0.5fr;
gap: 1rem;
}

Expand All @@ -131,14 +131,24 @@ a {
gap: 0.5rem;
}

.post-text .count {
display: flex;
flex-direction: column;
justify-content: space-around;
align-items: flex-start;
padding: 0.5rem 2rem 0.5rem 10vh;
font-size: medium;
gap: 0.5rem;
}

.count span {
padding: 0 0.25rem;
}

.like_count_btn {
display: flex;
flex-direction: row;
justify-content: space-around;
align-items: center;
gap: 1rem;
}

Expand All @@ -163,8 +173,11 @@ form input[type="submit"] {
padding: 5px;
}

.like_count_btn form {
width: 3vw;
.like_count_btn button {
width: 2vw;
height: 2vw;
font-size: x-large;
padding: 0;
}

form input[type="hidden"] {
Expand Down Expand Up @@ -257,6 +270,10 @@ form input {
padding: 0.5rem;
}

.like_count_btn form {
width: 3vw;
}

.comments form {
width: auto;
align-self: flex-end;
Expand Down
3 changes: 1 addition & 2 deletions app/controllers/posts_controller.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
class PostsController < ApplicationController

load_and_authorize_resource

def index
@user = User.includes(posts: { comments: :author }).find(params[:user_id])
@current_user = current_user
Expand Down
7 changes: 7 additions & 0 deletions app/views/posts/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@
0
<% end %>
</span>
<span>
<%= form_with(model: Like.new, url: like_user_post_path(post.author, post)) do |form| %>
<%= form.button type: :submit do %>
&#9829;
<% end %>
<% end %>
</span>
</div>
</div>
<hr />
Expand Down
7 changes: 7 additions & 0 deletions app/views/users/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,13 @@
0
<% end %>
</span>
<span>
<%= form_with(model: Like.new, url: like_user_post_path(post.author, post)) do |form| %>
<%= form.button type: :submit do %>
&#9829;
<% end %>
<% end %>
</span>
</div>
</div>
<hr />
Expand Down

0 comments on commit 1dab854

Please sign in to comment.