Improve code in items, pages, links
This commit is contained in:
1 parent
cf4a6c0b35
commit
0b71714d44
7 files changed
+37
-63
No files matched your search
@@ -12,13 +12,11 @@ class Admin::LinksController < ApplicationController
|
||||
|
||||
def new
|
||||
@item = Link.new
|
||||
@item.is_published = true
|
||||
@item.parent_id = Page.find(params[:parent_id]).id rescue nil
|
||||
@item.parent = Page.find(params[:parent_id]) rescue nil
|
||||
end
|
||||
|
||||
def edit
|
||||
@item = Link.find(params[:id])
|
||||
@i18n_variable = @item.i18n_variable
|
||||
end
|
||||
|
||||
def create
|
||||
@@ -34,7 +32,6 @@ class Admin::LinksController < ApplicationController
|
||||
end
|
||||
else
|
||||
flash.now[:error] = t('admin.create_error_link')
|
||||
@i18n_variable = @item.i18n_variable
|
||||
render :action => "new"
|
||||
end
|
||||
end
|
||||
@@ -52,7 +49,6 @@ class Admin::LinksController < ApplicationController
|
||||
end
|
||||
else
|
||||
flash.now[:error] = t('admin.update_error_link')
|
||||
@i18n_variable = @item.i18n_variable
|
||||
render :action => "edit"
|
||||
end
|
||||
end
|
||||
|
||||
Reference in new issue
Block a user