Allow blank for lien_demarche
This commit is contained in:
parent
1bd66b6a9e
commit
8ba8135e6b
4 changed files with 11 additions and 4 deletions
|
@ -6,8 +6,11 @@ class Admin::PiecesJustificativesController < AdminController
|
|||
end
|
||||
|
||||
def update
|
||||
@procedure.update_attributes(update_params)
|
||||
flash.now.notice = 'Modifications sauvegardées'
|
||||
if @procedure.update_attributes(update_params)
|
||||
flash.now.notice = 'Modifications sauvegardées'
|
||||
else
|
||||
flash.now.notice = 'Une erreur est survenue'
|
||||
end
|
||||
render 'show', format: :js
|
||||
end
|
||||
|
||||
|
|
|
@ -5,5 +5,5 @@ class TypeDePieceJustificative < ActiveRecord::Base
|
|||
|
||||
validates :libelle, presence: true, allow_blank: false, allow_nil: false
|
||||
|
||||
validates_format_of :lien_demarche, with: URI::regexp
|
||||
validates :lien_demarche, format: { with: URI::regexp }, allow_blank: true, allow_nil: true
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue