Skip to content

Commit

Permalink
created the all user page
Browse files Browse the repository at this point in the history
  • Loading branch information
peterrobert committed Jun 23, 2020
1 parent 103647e commit 0abd282
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 3 deletions.
11 changes: 9 additions & 2 deletions app/assets/stylesheets/application.scss
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,13 @@ form textarea {
color: grey;
}

.hidden{
display: none;
.usr{
text-transform: uppercase;
font-weight: bold;
font-family: 'Oleo Script', cursive;
font-size: 22px;
}

.cd{
margin-top: 10px;
}
2 changes: 1 addition & 1 deletion app/controllers/static_pages_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ def external

def friends
@users = User.where.not(id: current_user.id)
@expenses = Expense.where.not(user_id: current_user.id)
@expenses = Transaction.where.not(user_id: current_user.id).all
end
end
13 changes: 13 additions & 0 deletions app/views/static_pages/friends.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<% @users.each do |user| %>

<div class="container">
<div class="card cd">
<div class="card-header usr">
Friend: <span> <%= user.name %> </span>

</div>
</div>
</div>

<% end %>

5 changes: 5 additions & 0 deletions app/views/static_pages/home.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@
<i class="fa fa-plus-square" aria-hidden="true"></i> <%= link_to "All groups", groups_path, :class => "btn" %>
</li>

<hr>
<li>
<i class="fa fa-plus-square" aria-hidden="true"></i> <%= link_to "friends", friends_path, :class => "btn" %>
</li>

</ul>

</section>
Expand Down
1 change: 1 addition & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
resources :groups

get '/external', to: 'static_pages#external'
get '/friends', to: 'static_pages#friends'

# For details on the DSL available within this file, see https://guides.rubyonrails.org/routing.html
end

0 comments on commit 0abd282

Please sign in to comment.