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

Move logic to SessionWindow controller #5

Merged

Conversation

janpeterka
Copy link
Contributor

I suggest to have controller for Dashboard::SessionWindow separate, to keep things clean

@bensheldon bensheldon merged commit 865ad09 into bensheldon:main Sep 29, 2024
2 checks passed
@bensheldon
Copy link
Owner

lgtm 😁 I really appreciate the contributions you're making. Super helpful!

I think the next step for myself will be setting up RSpec and System Tests.

@session_window.events.delete_all
@session_window.delete

redirect_to "/spectator_sport_dashboard"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not happy with this, but spectator_sport_dashboard_path didn't work. I probably don't completely understand routing in context of Engines, so I didn't find a way to not use absolute path (which is not great).
Maybe you know how to improve this, @bensheldon ?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for flagging that, I totally overlooked that. As you're probably aware, it's not great because the routes could be mounted at a different path by the parent application.

I also struggled with some of the routing stuff. I think the problem may be that Engines are not intended to be namespace nested. This is the first gem I've done with 2 engines, which I believe is necessary to mount the client-api separately from the dashboard. I'll poke it some more and figure out a way forward.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh! I think it's simply because each engine is separately loading routes.rb, so it loads twice. Lemme fix that.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed it, I think 😓 #8

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.

2 participants