From 74ece9d971d186f1de6f0222afd236c92a69c7da Mon Sep 17 00:00:00 2001 From: nilsding Date: Fri, 2 Jan 2015 21:34:56 +0100 Subject: [PATCH] added privacy setting routes this took me longer than it should have taken --- app/controllers/user_controller.rb | 6 +++++- app/views/user/_settings_tabs.html.haml | 2 +- app/views/user/privacy.html.haml | 6 ++++++ config/routes.rb | 2 ++ 4 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 app/views/user/privacy.html.haml diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index 8124e1e8..ee51b783 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -1,5 +1,5 @@ class UserController < ApplicationController - before_filter :authenticate_user!, only: %w(edit update) + before_filter :authenticate_user!, only: %w(edit update privacy) def show @user = User.where('LOWER(screen_name) = ?', params[:username].downcase).first! @@ -26,6 +26,10 @@ class UserController < ApplicationController redirect_to edit_user_profile_path end + def privacy + + end + def followers @title = 'Followers' @user = User.where('LOWER(screen_name) = ?', params[:username].downcase).first! diff --git a/app/views/user/_settings_tabs.html.haml b/app/views/user/_settings_tabs.html.haml index 85aa90d5..05450613 100644 --- a/app/views/user/_settings_tabs.html.haml +++ b/app/views/user/_settings_tabs.html.haml @@ -4,7 +4,7 @@ %ul.nav.nav-pills.nav-stacked = nav_entry "Account", edit_user_registration_path = nav_entry "Profile", edit_user_profile_path - = nav_entry "Privacy", "#" + = nav_entry "Privacy", privacy_settings_path = nav_entry "Sharing", services_path diff --git a/app/views/user/privacy.html.haml b/app/views/user/privacy.html.haml new file mode 100644 index 00000000..4ae256cc --- /dev/null +++ b/app/views/user/privacy.html.haml @@ -0,0 +1,6 @@ +.container.j2-page + = render 'settings_tabs' + .col-md-9.col-xs-12.col-sm-9 + = render 'layouts/messages' + .panel.panel-default + .panel-body \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 49f115f0..df5ef086 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -57,6 +57,8 @@ Rails.application.routes.draw do end end + match '/settings/privacy', to: 'user#privacy', via: :get, as: :privacy_settings + namespace :ajax do match '/ask', to: 'question#create', via: :post, as: :ask match '/answer', to: 'inbox#destroy', via: :post, as: :answer