Commit c4a56797 authored by skv-headless's avatar skv-headless

transfer error handler

parent 19865b7c
......@@ -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
......
- 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)}";
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment