transfer error handler
This commit is contained in:
parent
19865b7cfd
commit
c4a56797a4
|
@ -51,12 +51,6 @@ window.ajaxGet = (url) ->
|
|||
|
||||
window.showAndHide = (selector) ->
|
||||
|
||||
window.errorMessage = (message) ->
|
||||
ehtml = $("<p>")
|
||||
ehtml.addClass("error_message")
|
||||
ehtml.html(message)
|
||||
ehtml
|
||||
|
||||
window.split = (val) ->
|
||||
return val.split( /,\s*/ )
|
||||
|
||||
|
|
|
@ -44,6 +44,9 @@ class ProjectsController < ApplicationController
|
|||
|
||||
def transfer
|
||||
::Projects::TransferService.new(project, current_user, project_params).execute
|
||||
if @project.errors[:namespace_id].present?
|
||||
flash[:alert] = @project.errors[:namespace_id].first
|
||||
end
|
||||
end
|
||||
|
||||
def show
|
||||
|
|
|
@ -1,7 +1,2 @@
|
|||
- if @project.errors[:namespace_id].present?
|
||||
:plain
|
||||
$("#tab-transfer .errors-holder").replaceWith(errorMessage('#{escape_javascript(@project.errors[:namespace_id].first)}'));
|
||||
$("#tab-transfer .form-actions input").removeAttr('disabled').removeClass('disabled');
|
||||
- else
|
||||
:plain
|
||||
:plain
|
||||
location.href = "#{edit_project_path(@project)}";
|
||||
|
|
Loading…
Reference in New Issue