Putting it in the applicationcontroller doesn't work. So instead I did the following. However, when I check the post_params, it still doesn't include my params eventhough params has it. I notice the post_params method append the attrs provided by storytime_post_param_additions instead of concat.
Storytime::Dashboard::DashboardController.class_eval do
before_action :parse_input, only: [:update]
def storytime_post_param_additions
attrs = [{:spree_product_ids => []}]
attrs
end
def parse_input
params[:spree_product_ids] = params[:spree_product_ids].split(',').map(&:to_i)
end
end
Putting it in the applicationcontroller doesn't work. So instead I did the following. However, when I check the post_params, it still doesn't include my params eventhough
params
has it. I notice thepost_params
method append the attrs provided bystorytime_post_param_additions
instead ofconcat
.