Code cleanup.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10984 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
8ab9215ea8
commit
ec7c512693
|
@ -31,7 +31,7 @@ class CustomFieldsController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def create
|
def create
|
||||||
if request.post? and @custom_field.save
|
if @custom_field.save
|
||||||
flash[:notice] = l(:notice_successful_create)
|
flash[:notice] = l(:notice_successful_create)
|
||||||
call_hook(:controller_custom_fields_new_after_save, :params => params, :custom_field => @custom_field)
|
call_hook(:controller_custom_fields_new_after_save, :params => params, :custom_field => @custom_field)
|
||||||
redirect_to custom_fields_path(:tab => @custom_field.class.name)
|
redirect_to custom_fields_path(:tab => @custom_field.class.name)
|
||||||
|
@ -44,7 +44,7 @@ class CustomFieldsController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def update
|
def update
|
||||||
if request.put? and @custom_field.update_attributes(params[:custom_field])
|
if @custom_field.update_attributes(params[:custom_field])
|
||||||
flash[:notice] = l(:notice_successful_update)
|
flash[:notice] = l(:notice_successful_update)
|
||||||
call_hook(:controller_custom_fields_edit_after_save, :params => params, :custom_field => @custom_field)
|
call_hook(:controller_custom_fields_edit_after_save, :params => params, :custom_field => @custom_field)
|
||||||
redirect_to custom_fields_path(:tab => @custom_field.class.name)
|
redirect_to custom_fields_path(:tab => @custom_field.class.name)
|
||||||
|
@ -54,10 +54,11 @@ class CustomFieldsController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def destroy
|
def destroy
|
||||||
@custom_field.destroy
|
begin
|
||||||
redirect_to custom_fields_path(:tab => @custom_field.class.name)
|
@custom_field.destroy
|
||||||
rescue
|
rescue
|
||||||
flash[:error] = l(:error_can_not_delete_custom_field)
|
flash[:error] = l(:error_can_not_delete_custom_field)
|
||||||
|
end
|
||||||
redirect_to custom_fields_path(:tab => @custom_field.class.name)
|
redirect_to custom_fields_path(:tab => @custom_field.class.name)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue