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

Web UI and Rails API mode #926

Closed
afuno opened this issue Dec 4, 2023 · 2 comments
Closed

Web UI and Rails API mode #926

afuno opened this issue Dec 4, 2023 · 2 comments

Comments

@afuno
Copy link

afuno commented Dec 4, 2023

Hello.

Can you please tell me how I can currently use the Web UI section in a Rails application that runs in API mode?

I get an error:

undefined method `flash' for #<ActionDispatch::Request GET "http://localhost:3000/maintenance_tasks" for ::1>

Is it possible, by defining the operating mode of a Rails application, to remove the definition/use of these methods?

@afuno
Copy link
Author

afuno commented Dec 4, 2023

Solution:

class Maintenance::Tasks::ApplicationController < ActionController::Base
  include ActionDispatch::Flash::RequestMethods
end
MaintenanceTasks.parent_controller = "Maintenance::Tasks::ApplicationController"

@afuno afuno closed this as completed Dec 4, 2023
@etiennebarrie
Copy link
Member

If this is all it takes, we could support it out of the box.

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

2 participants