Files
fizzy/app/controllers/buckets/views_controller.rb
T
2024-10-17 17:08:45 -06:00

24 lines
606 B
Ruby

class Buckets::ViewsController < ApplicationController
include BucketScoped
def create
@bucket_view = @bucket.views.create! filters: filter_params
redirect_to bucket_bubbles_path(@bucket, **filter_params), notice: ""
end
def update
@bucket_view.update! filters: filter_params
redirect_to bucket_bubbles_path(@bucket, **filter_params), notice: ""
end
def destroy
@bucket_view.destroy
redirect_to bucket_bubbles_path(@bucket, **filter_params), notice: ""
end
private
def filter_params
helpers.bubble_filter_params.to_h.compact_blank
end
end