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 @@

Edit <%= @user.email %>

-<%= simple_form_for(@user, url: user_path(@user), html: { method: :put }) do |f| %> +<%= simple_form_for(@user, url: account_path(@user), html: { method: :put }) do |f| %> <%= f.error_notification %>
diff --git a/app/views/accounts/index.html.erb b/app/views/accounts/index.html.erb index e9f7566..e1f6242 100644 --- a/app/views/accounts/index.html.erb +++ b/app/views/accounts/index.html.erb @@ -14,11 +14,11 @@ <% next if user.is_admin? %> <% next if user.equal?(current_user) %> - <%= link_to user.email, user %> - <%= link_to 'Edit', edit_user_path(user) %> - <%= link_to 'Destroy', user_path(user), method: :delete, data: { confirm: 'Are you sure?' } %> + <%= link_to user.email, account_path(user) %> + <%= link_to 'Edit', edit_account_path(user) %> + <%= link_to 'Destroy', account_path(user), method: :delete, data: { confirm: 'Are you sure?' } %> <% end %> -<%= link_to 'New user', new_user_path unless Rails.env.production? %> +<%= link_to 'New user', new_account_path unless Rails.env.production? %> diff --git a/app/views/accounts/new.html.erb b/app/views/accounts/new.html.erb index bec0242..d27f2a0 100644 --- a/app/views/accounts/new.html.erb +++ b/app/views/accounts/new.html.erb @@ -1,5 +1,5 @@

New User

-<%= simple_form_for(@user, url: users_path) do |f| %> +<%= simple_form_for(@user, url: accounts_path) do |f| %> <%= f.error_notification %>
diff --git a/app/views/layouts/_header.html.erb b/app/views/layouts/_header.html.erb index 901b232..bb8eb70 100644 --- a/app/views/layouts/_header.html.erb +++ b/app/views/layouts/_header.html.erb @@ -12,7 +12,7 @@