From 58c829571e07fb86c7be928a65d94e859666516d Mon Sep 17 00:00:00 2001 From: Rahul Date: Mon, 3 Jun 2019 19:50:48 +0530 Subject: [PATCH] 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. --- app/controllers/admin/booths_controller.rb | 3 ++- app/controllers/booths_controller.rb | 3 ++- app/models/booth.rb | 2 ++ app/views/booths/_form.html.haml | 2 ++ 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/controllers/admin/booths_controller.rb b/app/controllers/admin/booths_controller.rb index aceceee0..4082e69f 100644 --- a/app/controllers/admin/booths_controller.rb +++ b/app/controllers/admin/booths_controller.rb @@ -129,7 +129,8 @@ module Admin def booth_params 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 diff --git a/app/controllers/booths_controller.rb b/app/controllers/booths_controller.rb index df535459..cb14c9bd 100644 --- a/app/controllers/booths_controller.rb +++ b/app/controllers/booths_controller.rb @@ -94,6 +94,7 @@ class BoothsController < ApplicationController def booth_params 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 diff --git a/app/models/booth.rb b/app/models/booth.rb index 85c6c7a8..71ab6e98 100644 --- a/app/models/booth.rb +++ b/app/models/booth.rb @@ -4,6 +4,8 @@ class Booth < ApplicationRecord include ActiveRecord::Transitions has_paper_trail ignore: [:updated_at], meta: { conference_id: :conference_id } + attr_accessor :invite_responsible + belongs_to :conference has_many :booth_requests, dependent: :destroy has_many :users, through: :booth_requests diff --git a/app/views/booths/_form.html.haml b/app/views/booths/_form.html.haml index 4f5b6018..dfce22b1 100644 --- a/app/views/booths/_form.html.haml +++ b/app/views/booths/_form.html.haml @@ -12,6 +12,8 @@ hint: 'e.g. employee, comunity manager, etc' = f.input :website_url = 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? = f.input :picture