Right now it's a basic toggle! action with a link_to post request:
def batch_actions
if params[:toggle_id].present? && params[:toggle_id].to_i != 0
Organization.find(params[:toggle_id]).toggle!(:approved)
respond_to do |format|
format.html { redirect_to admin_organizations_path, notice: 'Approval Toggled' }
end
end
end
Right now it's a basic toggle! action with a link_to post request:
With the link_to:
Consider making this a true batch action where the admin can check off as many organizations as he/she wants and then toggle all at once.