I have 2 buttons sitting in an if else method and the first button is suppose to allow the user to change a boolean from false to true. Then if the model shows it is true it will show the other button which is a delete button. I cant get the toggle button (top one) to work right the delete is fine. Here is how it stands now.
def which_button(reportapproval)
if reportapproval.user_approved == false
button_to "Approve this Manager?", { controller: "users/reportapprovals", id: @reportapproval.id, action: "#not sure what goes here" }, method: :#not sure what goes here, data: {confirm: "Are you sure you want to give this manager access to your report?" }
else
button_to "Remove this Manager", { controller: "users/reportapprovals", id: @reportapproval.id, action: "destroy" }, method: :delete, data: {confirm: "Are you sure you want to remove this manager's access to your report?" }
end
end
But I keep getting the error Post route no found which i know is not right. I want this to toggle a boolean in the reportapproval model. Please show me what I need to do.