Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

500 Error When Using Language Selector Within Some URL Paths #3401

Open
aaronskiba opened this issue Apr 2, 2024 · 0 comments
Open

500 Error When Using Language Selector Within Some URL Paths #3401

aaronskiba opened this issue Apr 2, 2024 · 0 comments

Comments

@aaronskiba
Copy link
Contributor

aaronskiba commented Apr 2, 2024

Please complete the following fields as applicable:

What version of the DMPRoadmap code are you running? (e.g. v2.2.0)

  • v4.1.1

Steps to reproduce:

  • This bug appears to be related to the use of render :action_name within several of the codebase's controller actions.

e.g.

# app/controllers/contributors_controller.rb

  # PUT /plans/:plan_id/contributors/:id
  def update
    ...
      render :edit
    ...
  end

  # GET /plans/:plan_id/contributors/:id/edit
  def edit
    ...
  end

If render :edit is executed within the update action, then the edit view is rendered. However, the path remains on the /plans/:plan_id/contributors/:id PUT path.

From there, if we use the language selector, then the following code is executed:

  def update
    ...
    redirect_back(fallback_location: root_path)
  end

redirect_back seems to call the controller action that corresponds to the GET method for the current URL path. However, there is no controller action for GET /plans/:plan_id/contributors/:id within the codebase. As a result, the following error is rendered within development:

Screenshot from 2024-04-02 09-22-58

Throughout the codebase, there are controller actions that call render :x, without having a GET action corresponding to the current path that the app is on.

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

No branches or pull requests

1 participant