Namespace languages controller to admin

This commit is contained in:
maddiebaka
2023-10-25 16:25:29 -04:00
parent 206c4da31f
commit c2891a66f8
17 changed files with 43 additions and 41 deletions

View File

@@ -1,4 +1,4 @@
class LanguagesController < ApplicationController
class Admin::LanguagesController < ApplicationController
def index
@languages = Language.all
@@ -12,7 +12,7 @@ class LanguagesController < ApplicationController
@language = Language.new(language_params)
if @language.save
flash[:notice] = "Language successfully created."
redirect_to languages_path
redirect_to admin_languages_path
else
render :new, status: :unprocessable_entity
end
@@ -26,7 +26,7 @@ class LanguagesController < ApplicationController
@language = Language.find_by_id(params[:id])
if @language.update(language_params)
flash[:notice] = "Language successfully updated."
redirect_to languages_path
redirect_to admin_languages_path
else
render :edit, status: :unprocessable_entity
end
@@ -36,7 +36,7 @@ class LanguagesController < ApplicationController
@language = Language.find_by_id(params[:id])
if @language.destroy
flash[:notice] = "Language successfully deleted."
redirect_to languages_path
redirect_to admin_languages_path
else
render :index, status: :not_modified
end