Commit 96d03444

mo khan <mo@mokhan.ca>
2014-07-05 18:23:26
add a root path to the cakes section so we have /my#cakes route.
1 parent 1533642
Changed files (4)
app/controllers/registrations_controller.rb
@@ -1,6 +1,6 @@
 class RegistrationsController < Devise::RegistrationsController
   def after_sign_in_path_for(resource)
-    my_cakes_path
+    my_root_path(anchor: 'cakes')
   end
 
   def sign_up_params
app/views/layouts/_header.html.erb
@@ -11,7 +11,7 @@
             <a href="#" class="dropdown-toggle" data-toggle="dropdown">Creations<b class="caret"></b></a>
             <ul class="dropdown-menu">
               <li>
-              <%= link_to current_user ? my_cakes_path(anchor: 'cakes/new') : new_creation_path do %>
+              <%= link_to current_user ? my_root_path(anchor: 'cakes/new') : new_creation_path do %>
                 <i class="icon-edit icon-large"></i> Add Creation
               <% end %>
               </li>
@@ -69,7 +69,7 @@
         </ul>
         <ul class="nav pull-right">
           <li>
-            <%= link_to current_user ? my_cakes_path(anchor: 'cakes/new') : new_creation_path do %>
+            <%= link_to current_user ? my_root_path(anchor: 'cakes/new') : new_creation_path do %>
               <i class="icon-edit icon-large"></i> Add Creation
             <% end %>
           </li>
app/views/shared/_account_nav.html.erb
@@ -2,7 +2,7 @@
   <div class="span12">
     <ul class="nav nav-tabs">
       <li class="<%= selected == :dashboard ? "active" : "" %>"><%= link_to "Dashboard", my_dashboard_path %></li>
-      <li class="<%= selected == :creations ? "active" : "" %>"><%= link_to "Creations", my_cakes_path(anchor: 'cakes') %></li>
+      <li class="<%= selected == :creations ? "active" : "" %>"><%= link_to "Creations", my_root_path(anchor: 'cakes') %></li>
       <li class="<%= selected == :favorites ? "active" : "" %>"><%= link_to "Favorites", my_favorites_path %></li>
       <li class="<%= selected == :basic_info ? "active" : "" %>"><%= link_to "Settings", my_settings_path %></li>
       <li class="<%= selected == :password ? "active" : "" %>"><%= link_to "Password", my_passwords_path %></li>
config/routes.rb
@@ -74,5 +74,6 @@ Cake::Application.routes.draw do
     resources :settings, only: [:index, :update]
     resources :passwords, only: [:index, :update]
     resources :avatars, :only => [:edit, :update]
+    root to: "cakes#index"
   end
 end