|
|
@ -40,7 +40,7 @@ class LibrariesController < ApplicationController
|
|
|
|
redirect_to publish_success_libraries_path
|
|
|
|
redirect_to publish_success_libraries_path
|
|
|
|
else
|
|
|
|
else
|
|
|
|
flash[:message] = '保存成功'
|
|
|
|
flash[:message] = '保存成功'
|
|
|
|
render 'new'
|
|
|
|
redirect_to edit_library_path(id: @library.id)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
rescue ActiveRecord::RecordInvalid => _
|
|
|
|
rescue ActiveRecord::RecordInvalid => _
|
|
|
|
render 'new'
|
|
|
|
render 'new'
|
|
|
@ -64,7 +64,7 @@ class LibrariesController < ApplicationController
|
|
|
|
redirect_to publish_success_libraries_path
|
|
|
|
redirect_to publish_success_libraries_path
|
|
|
|
else
|
|
|
|
else
|
|
|
|
flash[:message] = '保存成功'
|
|
|
|
flash[:message] = '保存成功'
|
|
|
|
render 'edit'
|
|
|
|
redirect_to edit_library_path(id: @library.id)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
rescue ActiveRecord::RecordInvalid => _
|
|
|
|
rescue ActiveRecord::RecordInvalid => _
|
|
|
|
render 'edit'
|
|
|
|
render 'edit'
|
|
|
|