I want to use a form to create an admin page… where there are checkboxes signifying which image the admin has selected, and then three submit buttons : approve, edit, delete.
Is form_tag the best way to do this? If not, then if I just use simple buttons, how can I connect them to gather data from the selected checkbox?
Thank you…
one way is you can create one form with three buttons. if you are using form_tag, you can create three buttons by doing submit_tag three times. for the submit_tags use the same :name parameter but different values. When handling the form submit check for which button they clicked and then reroute to appropriate action.
doing it this way avoids having to use js to share the checkboxes with three different forms and so on.