Namespace languages controller to admin
This commit is contained in:
@@ -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
|
Reference in New Issue
Block a user