Add invite responsible to form

It is added so that user can enter email ids of other users, who they want to invite to become booth responsible.
This commit is contained in:
Rahul 2019-06-03 19:50:48 +05:30
parent 12f10c7dcd
commit 58c829571e
4 changed files with 8 additions and 2 deletions

View file

@ -129,7 +129,8 @@ module Admin
def booth_params def booth_params
params.require(:booth).permit(:title, :description, :reasoning, :state, :picture, :conference_id, params.require(:booth).permit(:title, :description, :reasoning, :state, :picture, :conference_id,
:created_at, :updated_at, :submitter_relationship, :website_url, responsible_ids: []) :created_at, :updated_at, :submitter_relationship, :website_url, :invite_responsible,
responsible_ids: [])
end end
end end
end end

View file

@ -94,6 +94,7 @@ class BoothsController < ApplicationController
def booth_params def booth_params
params.require(:booth).permit(:title, :description, :reasoning, :state, :picture, :conference_id, params.require(:booth).permit(:title, :description, :reasoning, :state, :picture, :conference_id,
:created_at, :updated_at, :submitter_relationship, :website_url, responsible_ids: []) :created_at, :updated_at, :submitter_relationship, :website_url, :invite_responsible,
responsible_ids: [])
end end
end end

View file

@ -4,6 +4,8 @@ class Booth < ApplicationRecord
include ActiveRecord::Transitions include ActiveRecord::Transitions
has_paper_trail ignore: [:updated_at], meta: { conference_id: :conference_id } has_paper_trail ignore: [:updated_at], meta: { conference_id: :conference_id }
attr_accessor :invite_responsible
belongs_to :conference belongs_to :conference
has_many :booth_requests, dependent: :destroy has_many :booth_requests, dependent: :destroy
has_many :users, through: :booth_requests has_many :users, through: :booth_requests

View file

@ -12,6 +12,8 @@
hint: 'e.g. employee, comunity manager, etc' hint: 'e.g. employee, comunity manager, etc'
= f.input :website_url = f.input :website_url
= responsibles_selector_input f = responsibles_selector_input f
= f.input :invite_responsible,
hint: 'This field is to invite unregistered users using their email to become booth responsibles.'
= image_tag f.object.picture.thumb.url if f.object.picture? = image_tag f.object.picture.thumb.url if f.object.picture?
= f.input :picture = f.input :picture