Simplification of the 'link_back' code
This commit is contained in:
1 parent
d88cae437d
commit
1909edbe2a
13 files changed
+23
-44
No files matched your search
@@ -14,12 +14,10 @@ class Admin::AssetsController < ApplicationController
|
||||
|
||||
def edit
|
||||
@asset = Asset.find(params[:id])
|
||||
session[:last_page] = get_go_back || admin_assets_url
|
||||
end
|
||||
|
||||
def new
|
||||
@asset = Asset.new
|
||||
session[:last_page] = get_go_back || admin_assets_url
|
||||
end
|
||||
|
||||
def create
|
||||
|
||||
@@ -12,13 +12,11 @@ class Admin::HomesController < ApplicationController
|
||||
@home = Home.new
|
||||
@home.is_published = true
|
||||
@home.parent_id = nil
|
||||
session[:last_page] = get_go_back || admin_items_url
|
||||
end
|
||||
|
||||
def edit
|
||||
@home = Home.find(params[:id])
|
||||
@i18n_variable = @home.i18n_variable
|
||||
session[:last_page] = get_go_back || admin_items_url
|
||||
end
|
||||
|
||||
def create
|
||||
|
||||
@@ -16,12 +16,10 @@ class Admin::LayoutsController < ApplicationController
|
||||
|
||||
def new
|
||||
@layout = Layout.new
|
||||
session[:last_page] = get_go_back || admin_layouts_url
|
||||
end
|
||||
|
||||
def edit
|
||||
@layout = Layout.find(params[:id])
|
||||
session[:last_page] = get_go_back || admin_layouts_url
|
||||
end
|
||||
|
||||
def create
|
||||
|
||||
@@ -13,13 +13,11 @@ class Admin::LinksController < ApplicationController
|
||||
@link = Link.new
|
||||
@link.is_published = true
|
||||
@link.parent_id = @parent_item.id rescue nil
|
||||
session[:last_page] = get_go_back || admin_links_url
|
||||
end
|
||||
|
||||
def edit
|
||||
@link = Link.find(params[:id])
|
||||
@i18n_variable = @link.i18n_variable
|
||||
session[:last_page] = get_go_back || admin_links_url
|
||||
end
|
||||
|
||||
def create
|
||||
|
||||
@@ -13,14 +13,12 @@ class Admin::PagesController < ApplicationController
|
||||
@page = Page.new
|
||||
@page.is_published = true
|
||||
@page.parent_id = @parent_item.id rescue nil
|
||||
session[:last_page] = get_go_back || admin_items_url
|
||||
end
|
||||
|
||||
def edit
|
||||
@page = Page.find(params[:id])
|
||||
@page.content = parse_content(@page.content, {:locale => 'show'})
|
||||
@i18n_variable = @page.i18n_variable
|
||||
session[:last_page] = get_go_back || admin_items_url
|
||||
end
|
||||
|
||||
def create
|
||||
|
||||
@@ -12,12 +12,10 @@ class Admin::SnippetsController < ApplicationController
|
||||
def new
|
||||
@snippet = Snippet.new
|
||||
@snippet.parent_id = @parent_item.id
|
||||
session[:last_page] = get_go_back || admin_items_url
|
||||
end
|
||||
|
||||
def edit
|
||||
@snippet = Snippet.find(params[:id])
|
||||
session[:last_page] = get_go_back || admin_items_url
|
||||
end
|
||||
|
||||
def create
|
||||
|
||||
@@ -10,7 +10,6 @@ class Admin::TranslationsController < ApplicationController
|
||||
|
||||
def edit
|
||||
set_variables
|
||||
session[:last_page] = get_go_back || admin_translations_url
|
||||
end
|
||||
|
||||
# Update either the i18n_variables or the languages
|
||||
|
||||
@@ -16,14 +16,12 @@ class Admin::UserInfoModelsController < ApplicationController
|
||||
|
||||
def new
|
||||
@user_attribute_model = UserInfoModel.new
|
||||
session[:last_page] = get_go_back || admin_user_info_models_url
|
||||
render :template => 'admin/user_attribute_models/new'
|
||||
end
|
||||
|
||||
def edit
|
||||
@user_attribute_model = UserInfoModel.find(params[:id])
|
||||
@i18n_variable = @user_attribute_model.i18n_variable
|
||||
session[:last_page] = get_go_back || admin_user_info_models_url
|
||||
render :template => 'admin/user_attribute_models/edit'
|
||||
end
|
||||
|
||||
|
||||
@@ -16,14 +16,12 @@ class Admin::UserRoleModelsController < ApplicationController
|
||||
|
||||
def new
|
||||
@user_attribute_model = UserRoleModel.new
|
||||
session[:last_page] = get_go_back || admin_user_role_models_url
|
||||
render :template => 'admin/user_attribute_models/new'
|
||||
end
|
||||
|
||||
def edit
|
||||
@user_attribute_model = UserRoleModel.find(params[:id])
|
||||
@i18n_variable = @user_attribute_model.i18n_variable
|
||||
session[:last_page] = get_go_back || admin_user_role_models_url
|
||||
render :template => 'admin/user_attribute_models/edit'
|
||||
end
|
||||
|
||||
|
||||
Reference in new issue
Block a user