From 0abd282a631d18f3e65e5aa016d4c40ad5b0f8e7 Mon Sep 17 00:00:00 2001 From: peterrobert Date: Tue, 23 Jun 2020 19:03:50 +0300 Subject: [PATCH] created the all user page --- app/assets/stylesheets/application.scss | 11 +++++++++-- app/controllers/static_pages_controller.rb | 2 +- app/views/static_pages/friends.html.erb | 13 +++++++++++++ app/views/static_pages/home.html.erb | 5 +++++ config/routes.rb | 1 + 5 files changed, 29 insertions(+), 3 deletions(-) create mode 100644 app/views/static_pages/friends.html.erb diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index d315721..af85615 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -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; } \ No newline at end of file diff --git a/app/controllers/static_pages_controller.rb b/app/controllers/static_pages_controller.rb index 9dd56ec..cf21e40 100644 --- a/app/controllers/static_pages_controller.rb +++ b/app/controllers/static_pages_controller.rb @@ -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 diff --git a/app/views/static_pages/friends.html.erb b/app/views/static_pages/friends.html.erb new file mode 100644 index 0000000..f0bd1b7 --- /dev/null +++ b/app/views/static_pages/friends.html.erb @@ -0,0 +1,13 @@ +<% @users.each do |user| %> + +
+
+
+ Friend: <%= user.name %> + +
+
+
+ +<% end %> + diff --git a/app/views/static_pages/home.html.erb b/app/views/static_pages/home.html.erb index 8c1e771..ba824e3 100644 --- a/app/views/static_pages/home.html.erb +++ b/app/views/static_pages/home.html.erb @@ -28,6 +28,11 @@ <%= link_to "All groups", groups_path, :class => "btn" %> +
+
  • + <%= link_to "friends", friends_path, :class => "btn" %> +
  • + diff --git a/config/routes.rb b/config/routes.rb index a1aba4d..e763be9 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -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