@@ -31,7 +31,7 class CustomFieldsController < ApplicationController | |||
|
31 | 31 | end |
|
32 | 32 | |
|
33 | 33 | def create |
|
34 |
if |
|
|
34 | if @custom_field.save | |
|
35 | 35 | flash[:notice] = l(:notice_successful_create) |
|
36 | 36 | call_hook(:controller_custom_fields_new_after_save, :params => params, :custom_field => @custom_field) |
|
37 | 37 | redirect_to custom_fields_path(:tab => @custom_field.class.name) |
@@ -44,7 +44,7 class CustomFieldsController < ApplicationController | |||
|
44 | 44 | end |
|
45 | 45 | |
|
46 | 46 | def update |
|
47 |
if |
|
|
47 | if @custom_field.update_attributes(params[:custom_field]) | |
|
48 | 48 | flash[:notice] = l(:notice_successful_update) |
|
49 | 49 | call_hook(:controller_custom_fields_edit_after_save, :params => params, :custom_field => @custom_field) |
|
50 | 50 | redirect_to custom_fields_path(:tab => @custom_field.class.name) |
@@ -54,10 +54,11 class CustomFieldsController < ApplicationController | |||
|
54 | 54 | end |
|
55 | 55 | |
|
56 | 56 | def destroy |
|
57 | @custom_field.destroy | |
|
58 | redirect_to custom_fields_path(:tab => @custom_field.class.name) | |
|
59 | rescue | |
|
60 | flash[:error] = l(:error_can_not_delete_custom_field) | |
|
57 | begin | |
|
58 | @custom_field.destroy | |
|
59 | rescue | |
|
60 | flash[:error] = l(:error_can_not_delete_custom_field) | |
|
61 | end | |
|
61 | 62 | redirect_to custom_fields_path(:tab => @custom_field.class.name) |
|
62 | 63 | end |
|
63 | 64 |
General Comments 0
You need to be logged in to leave comments.
Login now