Phoenix.HTML.Form.input_value/2 -> Updated all occurrences where field names are used in inputs_for, input, and other form-related functions to use atoms.
Assign :form in handle_params:
Original: The form assignment was missing in the handle_params function.
Updated: In the handle_params function, the form is now assigned using the to_form(changeset) function along with poll and changeset.
Redirect Path in handle_event("save"):
Original: Routes.poll_path(socket, :index) was incorrect.
Updated: Changed poll_path to poll_index_path for correct redirection after saving the poll.
Form Usage in render Function:
Original: Incorrect usage of @changeset in the form rendering part.
Updated: Changed @changeset to @form for correctly rendering the form.
Input Field Naming in Form:
Original: Incorrect usage of dynamic field values in the input fields.
Updated: Used Phoenix.HTML.Form.input_value(@form, :field_name) to correctly set values for the input fields in the form.
Button Target in add-option Event:
Original: phx-target={@myself} was used which is unnecessary.
Updated: Removed phx-target attribute from the "Add" button in the form.
Phoenix.HTML.Form.input_value/2 -> Updated all occurrences where field names are used in inputs_for, input, and other form-related functions to use atoms.
Assign :form in handle_params:
Original: The form assignment was missing in the handle_params function. Updated: In the handle_params function, the form is now assigned using the to_form(changeset) function along with poll and changeset.
Redirect Path in handle_event("save"): Original: Routes.poll_path(socket, :index) was incorrect. Updated: Changed poll_path to poll_index_path for correct redirection after saving the poll.
Form Usage in render Function: Original: Incorrect usage of @changeset in the form rendering part. Updated: Changed @changeset to @form for correctly rendering the form.
Input Field Naming in Form: Original: Incorrect usage of dynamic field values in the input fields. Updated: Used Phoenix.HTML.Form.input_value(@form, :field_name) to correctly set values for the input fields in the form.
Button Target in add-option Event: Original: phx-target={@myself} was used which is unnecessary. Updated: Removed phx-target attribute from the "Add" button in the form.
Fixes #12