Commit f4e2847e by tady

Merge pull request #73 from tadyjp/wip/140401_fix_devise

[WIP] deviseのroutingエラー修正
parents 5480173c 36905501
...@@ -49,6 +49,7 @@ end ...@@ -49,6 +49,7 @@ end
gem 'mysql2' gem 'mysql2'
gem 'devise' gem 'devise'
gem 'omniauth-google-oauth2' gem 'omniauth-google-oauth2'
# Markdown # Markdown
......
...@@ -7,7 +7,7 @@ class UsersController < ApplicationController ...@@ -7,7 +7,7 @@ class UsersController < ApplicationController
def update def update
respond_to do |format| respond_to do |format|
if @user.update(user_params) if @user.update(user_params)
format.html { redirect_to edit_user_path(@user), flash: { notice: 'Post was successfully updated.' } } format.html { redirect_to edit_user_path, flash: { notice: 'Post was successfully updated.' } }
format.json { head :no_content } format.json { head :no_content }
else else
format.html { render action: 'edit' } format.html { render action: 'edit' }
......
...@@ -40,6 +40,6 @@ nav.navbar.navbar-default.navbar-fixed-top role="navigation" ...@@ -40,6 +40,6 @@ nav.navbar.navbar-default.navbar-fixed-top role="navigation"
a href=edit_user_path(current_user) マイページ a href=edit_user_path(current_user) マイページ
li.divider li.divider
li li
a href=destroy_user_session_path data-method="delete" rel="nofollow" SignOut a href=sign_out_path data-method="delete" rel="nofollow" SignOut
...@@ -21,8 +21,16 @@ Rendezvous::Application.routes.draw do ...@@ -21,8 +21,16 @@ Rendezvous::Application.routes.draw do
post 'tags/:name/move_to/:move_to_name' => 'tags#move_to', as: 'move_to_tag' post 'tags/:name/move_to/:move_to_name' => 'tags#move_to', as: 'move_to_tag'
resources :tags, :param => :name resources :tags, :param => :name
resources :users, :only => [:edit, :update] resource :user, :only => [:edit, :update]
devise_for :users , controllers: { omniauth_callbacks: 'users/omniauth_callbacks' }
# devise_for :users , controllers: { omniauth_callbacks: 'users/omniauth_callbacks' }
# devise_for :users , only: [:sign_in, :sign_out, :session]
devise_for :users, controllers: { omniauth_callbacks: "users/omniauth_callbacks" }, skip: [:sessions]
devise_scope :user do
# get 'sign_in', to: 'users/sessions#new', as: :new_user_session
delete 'sign_out', to: 'devise/sessions#destroy', as: :sign_out
end
# get 'users/edit' => 'users#edit', as: 'edit_user' # get 'users/edit' => 'users#edit', as: 'edit_user'
# post 'users/update' => 'users#update', as: 'update_user' # post 'users/update' => 'users#update', as: 'update_user'
......
...@@ -2,20 +2,23 @@ require 'spec_helper' ...@@ -2,20 +2,23 @@ require 'spec_helper'
describe UsersController do describe UsersController do
before do
end
describe "GET 'edit'" do describe "GET 'edit'" do
pending login_user
# it "returns http success" do it "returns http success" do
# get :edit get :edit
# response.should be_success response.should be_success
# end end
end end
describe "GET 'update'" do describe "GET 'update'" do
pending login_user
# it "returns http success" do it "returns http success" do
# put :update patch :update, user: { nickname: 'bob' }
# response.should be_success response.should redirect_to('/user/edit')
# end end
end end
end end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment