added privacy setting routes

this took me longer than it should have taken
This commit is contained in:
nilsding 2015-01-02 21:34:56 +01:00
parent 97086a8a9a
commit 74ece9d971
4 changed files with 14 additions and 2 deletions

View File

@ -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!

View File

@ -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

View File

@ -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

View File

@ -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