Commit 2d56baab

mo khan <mo@mokhan.ca>
2013-07-27 02:50:39
fix routes to passwords controller so that they do not collide with devise passwords controller paths
1 parent 5de97f1
Changed files (3)
app/views/passwords/index.html.erb
@@ -2,7 +2,7 @@
 
 <div class="row">
   <div class="span12">
-    <%= form_for(@user, :url => password_path(@user), :html => { :method => :put, :class => "form-horizontal" }) do |f| %>
+    <%= form_for(@user, :url => pwd_path, :html => { :method => :patch, :class => "form-horizontal" }) do |f| %>
       <div class="control-group">
         <%= f.label :password, "New password", :class => "control-label" %>
         <div class="controls">
app/views/shared/_account_nav.html.erb
@@ -2,7 +2,7 @@
   <div class="span12">
     <ul class="nav nav-tabs">
       <li class="<%= selected == :basic_info ? "active" : "" %>"><%= link_to "Settings", settings_path %></li>
-      <li class="<%= selected == :password ? "active" : "" %>"><%= link_to "Password", passwords_path %></li>
+      <li class="<%= selected == :password ? "active" : "" %>"><%= link_to "Password", pwd_path %></li>
       <li class="<%= selected == :picture ? "active" : "" %>"><%= link_to "Picture", edit_avatar_path(@user) %></li>
       <li class="<%= selected == :creations ? "active" : "" %>"><%= link_to "Creations", mine_creations_path %></li>
       <li class="<%= selected == :favorites ? "active" : "" %>"><%= link_to "Favorites", profiles_favorites_path %></li>
config/routes.rb
@@ -46,8 +46,9 @@ Cake::Application.routes.draw do
   get "/sitemap.xml", :to => "sitemap#index", :defaults => {:format => :xml}
 
   resources :settings, :only => [:index, :update]
-  resources :passwords, :only => [:index, :update], :path => :pwd
   resources :avatars, :only => [:edit, :update]
+  get 'pwd' => "passwords#index"
+  patch 'pwd' => "passwords#update"
 
   root :to => "creations#index"