Skip to content

Conversation

@NivedHari
Copy link
Contributor

@NivedHari NivedHari commented Nov 29, 2024

Add support for file attachments to Questions

Summary:

  • Enhanced the Question model to support file attachments.
  • Updated the QuestionForm service to handle file uploads dynamically
  • Modified the form view to allow multiple file uploads.
  • Conditionally rendered attached files in the view, including the option to open files in a new tab.

Key Changes:

Model Changes:

  • Added has_many_attached :files to the Question model

Service Changes:

  • Updated the QuestionForm to handle attaching multiple files (files)
  • Implemented logic in the attach_files method to attach files accordingly.

Form Changes:

  • Updated the form to accept file uploads.

View Changes:

  • Conditionally rendered attached files, ensuring that if multiple files are attached, each file is displayed as a separate link.

Recording:

attachment.mp4

@NivedHari NivedHari force-pushed the question-attachment branch 3 times, most recently from 7b39650 to d46345d Compare December 2, 2024 09:32
@n1vedhar1 n1vedhar1 force-pushed the question-attachment branch 6 times, most recently from 4cd0abf to 0fd893c Compare December 3, 2024 04:24
@n1vedhar1 n1vedhar1 force-pushed the question-attachment branch from 0fd893c to 68f7439 Compare December 3, 2024 13:51
@iffyuva iffyuva merged commit 1caf693 into codemancers:master Dec 3, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants