Can be check TypeDeChamps with attribut mandatory
This commit is contained in:
parent
26431ac528
commit
494f80afff
4 changed files with 13 additions and 2 deletions
|
@ -19,7 +19,7 @@ class Admin::TypesDeChampController < AdminController
|
|||
end
|
||||
|
||||
def update_params
|
||||
params.require(:procedure).permit(types_de_champ_attributes: [:libelle, :description, :order_place, :type_champ, :id])
|
||||
params.require(:procedure).permit(types_de_champ_attributes: [:libelle, :description, :order_place, :type_champ, :id, :mandatory])
|
||||
end
|
||||
|
||||
def move_up
|
||||
|
|
|
@ -9,6 +9,11 @@
|
|||
.form-group
|
||||
%h4 Description
|
||||
= ff.text_area :description, class: 'form-control description', placeholder: 'Description'
|
||||
.form-group
|
||||
%h4 Obligatoire ?
|
||||
.center
|
||||
= ff.check_box :mandatory, placeholder: 'Obligatoire ?'
|
||||
|
||||
.form-group
|
||||
= ff.hidden_field :order_place, value: ff.index
|
||||
= ff.hidden_field :id
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
class AddMandatoryToTypeDeChamps < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :types_de_champ, :mandatory, :boolean, default: false
|
||||
end
|
||||
end
|
|
@ -11,7 +11,7 @@
|
|||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(version: 20160314161959) do
|
||||
ActiveRecord::Schema.define(version: 20160315101245) do
|
||||
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "plpgsql"
|
||||
|
@ -244,6 +244,7 @@ ActiveRecord::Schema.define(version: 20160314161959) do
|
|||
t.integer "order_place"
|
||||
t.integer "procedure_id"
|
||||
t.text "description"
|
||||
t.boolean "mandatory", default: false
|
||||
end
|
||||
|
||||
create_table "types_de_piece_justificative", force: :cascade do |t|
|
||||
|
|
Loading…
Reference in a new issue