From f7f71e9cc9ea5ea82198feb21021ae1541ae2b4a Mon Sep 17 00:00:00 2001 From: nilsding Date: Mon, 10 Nov 2014 13:04:10 +0100 Subject: [PATCH] modified show_user_profile routes, added ajax route --- app/views/layouts/_header.html.haml | 2 +- config/routes.rb | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/views/layouts/_header.html.haml b/app/views/layouts/_header.html.haml index be9ebbd6..ff52b6bd 100644 --- a/app/views/layouts/_header.html.haml +++ b/app/views/layouts/_header.html.haml @@ -17,7 +17,7 @@ = current_user.screen_name %b.caret %ul.dropdown-menu - %li= link_to "View profile", show_user_profile_at_path(current_user.screen_name) + %li= link_to "View profile", show_user_profile_path(current_user.screen_name) %li= link_to "Settings", edit_user_registration_path %li.divider %li= link_to "Logout", destroy_user_session_path, method: :delete diff --git a/config/routes.rb b/config/routes.rb index 2d809d99..0ca1c69e 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -22,8 +22,12 @@ Rails.application.routes.draw do match '/settings/profile', to: 'user#edit', via: 'get', as: :edit_user_profile match '/settings/profile', to: 'user#update', via: 'patch', as: :update_user_profile + + namespace :ajax do + match '/ask', to: 'ajax#ask', via: :post, as: :ajax_ask + end match '/user/:username', to: 'user#show', via: 'get' - match '/@:username', to: 'user#show', via: 'get', as: :show_user_profile_at - match '/:username', to: 'user#show', via: 'get', as: :show_user_profile + match '/@:username', to: 'user#show', via: 'get', as: :show_user_profile + match '/:username', to: 'user#show', via: 'get', as: :show_user_profile_alt end