diff --git a/app/controllers/accounts_controller.rb b/app/controllers/accounts_controller.rb index 4a11646..fa84515 100644 --- a/app/controllers/accounts_controller.rb +++ b/app/controllers/accounts_controller.rb @@ -15,7 +15,7 @@ class AccountsController < ApplicationController def edit if @user.is_admin? - redirect_to users_path, notice: 'Admins are not editable by other admins.' + redirect_to accounts_path, notice: 'Admins are not editable by other admins.' end end @@ -24,7 +24,7 @@ class AccountsController < ApplicationController respond_to do |format| if @user.save - format.html { redirect_to @user, notice: 'User was successfully created.' } + format.html { redirect_to account_path(@user), notice: 'User was successfully created.' } format.json { render action: 'show', status: :created, location: @user } else format.html { render action: 'new' } @@ -38,7 +38,7 @@ class AccountsController < ApplicationController params[:user].delete(:current_password) respond_to do |format| if @user.update(user_params) - format.html { redirect_to @user, notice: 'User was successfully updated.' } + format.html { redirect_to account_path(@user), notice: 'User was successfully updated.' } format.json { head :no_content } else format.html { render action: 'edit', notice: @user.errors } @@ -52,7 +52,7 @@ class AccountsController < ApplicationController def destroy @user.destroy respond_to do |format| - format.html { redirect_to users_url } + format.html { redirect_to accounts_url } format.json { head :no_content } end end diff --git a/app/views/accounts/edit.html.erb b/app/views/accounts/edit.html.erb index fb34d84..41bf13d 100644 --- a/app/views/accounts/edit.html.erb +++ b/app/views/accounts/edit.html.erb @@ -1,6 +1,6 @@