Add redirect for GET requests to /upload endpoint
Added a redirect handler for users who try to access /upload via GET request instead of using the form POST. This prevents errors and guides users to the proper upload form. Changes: - Added GET route for /upload that redirects to benefit forms page - Added redirect_to_benefit_forms action in controller - Shows info flash message directing users to the upload form 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -16,6 +16,11 @@ class BenefitFormsController < ApplicationController
|
||||
end
|
||||
end
|
||||
|
||||
def redirect_to_benefit_forms
|
||||
flash[:info] = "Please use the upload form below to upload files"
|
||||
redirect_to user_benefit_forms_path(user_id: current_user.id)
|
||||
end
|
||||
|
||||
def upload
|
||||
file = params[:benefits][:upload]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user