Closed cmcguff closed 4 years ago
I don't think params.permit(:leave_request_report)[:leave_request_report]
is going to work. Make sure your a[href]
has the value with required parameters. I think it should be params.require(:leave_request_report).permit!
.
If I change it use permit! I'm getting an error:
param is missing or the value is empty: leave_request_report
Which I guess is coming from the index action on first load there are no params:
inputs = (params[:leave_request_report] || {}).merge(current_user: current_user)
I've been able to work around it now by calling the index with an empty object to seed it - not sure if it's the rails way, but it's working! Happy to close this.
link_to leave_request_reports_path(leave_request_report: { user_id: "" } )
Good to know. I think better workarounds exist though.
You may do it like this too:
url_for(format: 'csv', leave_request_report: @grid.attributes)
I have upgraded from rails 4-6 and having an issue with downloading filtered data to csv using the example in the docs - everything else is working fine. I'm using datagrid 1.6.0
The code I have here used to work in rails 4, but now no longer filters - I assume it's related to strong parameters but I'm not clear on exactly how to resolve it with the datagrid.
the download option on the form:
The backing controller:
and the datagrid classs: