Merge pull request 'Feature: Allow changing the status of guests in bulk' (#71) from bulk-status-changes into main
Reviewed-on: #71
This commit is contained in:
commit
597a4a6b9c
@ -1,2 +1,13 @@
|
|||||||
class ApplicationController < ActionController::Base
|
class ApplicationController < ActionController::Base
|
||||||
|
after_action :set_csrf_cookie
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def set_csrf_cookie
|
||||||
|
cookies["csrf-token"] = {
|
||||||
|
value: form_authenticity_token,
|
||||||
|
secure: Rails.env.production?,
|
||||||
|
same_site: :strict,
|
||||||
|
}
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
@ -75,6 +75,11 @@ class GuestsController < ApplicationController
|
|||||||
redirect_to guests_url
|
redirect_to guests_url
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def bulk_update
|
||||||
|
Guest.where(id: params[:guest_ids]).update!(params.require(:properties).permit(:status))
|
||||||
|
render json: {}, status: :ok
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
# Use callbacks to share common setup or constraints between actions.
|
# Use callbacks to share common setup or constraints between actions.
|
||||||
|
@ -73,4 +73,6 @@ Rails.application.configure do
|
|||||||
|
|
||||||
# Raise error when a before_action's only/except options reference missing actions
|
# Raise error when a before_action's only/except options reference missing actions
|
||||||
config.action_controller.raise_on_missing_callback_actions = true
|
config.action_controller.raise_on_missing_callback_actions = true
|
||||||
|
|
||||||
|
config.hosts << "libre-wedding-planner.app.localhost"
|
||||||
end
|
end
|
||||||
|
@ -2,6 +2,7 @@ Rails.application.routes.draw do
|
|||||||
resources :groups, only: :index
|
resources :groups, only: :index
|
||||||
resources :guests do
|
resources :guests do
|
||||||
post :import, on: :collection
|
post :import, on: :collection
|
||||||
|
post :bulk_update, on: :collection
|
||||||
end
|
end
|
||||||
resources :expenses
|
resources :expenses
|
||||||
resources :tables_arrangements, only: [:index, :show]
|
resources :tables_arrangements, only: [:index, :show]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user