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

Allow to have both Rails and Rage controllers in one application #83

Merged
merged 2 commits into from
May 7, 2024

Conversation

rsamoilov
Copy link
Member

No description provided.

rsamoilov added 2 commits May 3, 2024 12:26
this allows to have both Rails and Rage controllers in one application
@efibootmgr
Copy link

efibootmgr commented May 6, 2024

I came across a problem actually, because RageController doesn't support any gems that patch Rails controller. Like serializer gems that allow you to write something like
render json: Model, serializer: ModelSerializer
The RageController does not get those features.
Probably, Rage should patch Rails controllers instead (if rails detected) so all rails features would work properly.

@rsamoilov
Copy link
Member Author

huh, that's an interesting point. Are you talking about ActiveModelSerializers?

In general, given how Rage and Rails are different internally, I am not sure it would be possible to patch Rails controllers. My expectation is that gem maintainers would need to update their code to patch Rage controllers too.

@efibootmgr
Copy link

Thanks for reply, i think so. It's not critical, experienced developer can add features like that manually to rage controllers of course, if really needed. Just wanted to point to one downside/problem of using Rage and Rails together.
I was also having problems with rage console command, when triyng to use it in rage + rails template. Using any sql queries results in
No connection pool for 'ActiveRecord::Base' found. (ActiveRecord::ConnectionNotEstablished)
The rails console work properly and gets active record connection from config.

@rsamoilov
Copy link
Member Author

Thanks! This should be fixed in #84.

@rsamoilov rsamoilov merged commit 4f3d70a into master May 7, 2024
5 checks passed
@rsamoilov rsamoilov deleted the cascade branch May 7, 2024 18:37
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