-
Notifications
You must be signed in to change notification settings - Fork 58
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
Phase 2 configuration #15
base: main
Are you sure you want to change the base?
Conversation
@jelaniwoods @raghubetina I'm having trouble envisioning how we have only one Rails 7 templated for both "Phase 1" and "Phase 2"; while the database configuration could be merged in theory by switching all Phase 1 projects to use Postgres, the other configurations which you can see in e.g. It seems kind of unavoidable to have two templates. Given these few differences alone, rather than needing to remember to change the configuration settings every time one sets up a new either Phase 1 or Phase 2 project. Thoughts? Should we have two templates and name them something like |
I might be missing some context, but I thought after we determined the each "phase" needed different settings we concluded that we do need two templates, but unlike before they can share the same Docker image– which was the big time saver. |
Hmm, the only setting I see that is incompatible is:
(The other one that we used to have but no longer have is:
) Are there any other incompatibilities? (I think it's okay to include Perhaps we can figure out a workaround if |
I'm certain that some other settings are being handled by rails-7-template/config/initializers/appdev_support.rb Lines 1 to 7 in faa7d54
There might be other settings from this commit that still need to be handled. |
You beat me to that yes, I was just pushing a fresh commit on this PR that included what I think are the important configurations to change for Phase 2 projects, where we "take off the training wheels". I guess it's not as bad as I thought, but still requires some thought when generating a new project. Did I miss anything in the changed files? |
Hmm. If the Phase 2 gems/settings are a strict subset of Phase 1's, then maybe we could separate the settings into two gems? Then for Phase 2 students (or us when creating Phase 2 projects from the template), disabling the "training wheels" would be a matter of removing one gem from the |
I think we can put a pin in this conversation for now, if my current updates on this branch seem to cover basic config difference for Phase 2 projects. This came up because I'm currently trying to fill in the DPI canvas and on the Phase 2 content where I realized there were some setting differences. If this PR looks good at the moment, I can just use it for reference for now to generated those few phase 2 projects (there aren't many, mostly helper methods and photogram industrial) |
@jelaniwoods I'm having an issue with forgery protection in Codespaces; locally, I set # config/application.rb
config.action_controller.default_protect_from_forgery = true And it works fine, requiring a hidden authenticity token in the POST form. But in this app (https://github.com/appdev-projects/helper-methods-part-1-and-2) in a GitHub codespace; I get the server log error:
When I use the new movie form. I'm not sure the best way to solve this / if it is a Docker image issue? Edit: Turns out I can get it working by adding: # config/application.rb
config.action_controller.forgery_protection_origin_check = false But is that a bad idea? i.e., Would that be dangerous if someone deployed to production? It looks like this is an additional line of CSRF defense |
I don't remember running into this issue with vanilla-rails in Gitpod, so it might be a codespaces bug. I found a related issue which appears to confirm your solution as the only viable work-around. It should be in |
@jelaniwoods Aha, nice! Thanks. That solves the issue, see my latest commit. This seems like one thing that should actually be added to |
Yes, you're right. 🤔 It's still odd to me that this is required at all, since I remember doing significant testing on this template to make sure everything worked in Codespaces. I guess it could be something recent with Codespaces and/or Rails. |
637f8f9
to
4b4ef68
Compare
354bf6a
to
1df333a
Compare
For the AppDev 2 content, we want to use postgres DB. This needs to be in conjunction with this linear ticket, but that will take some more time: https://linear.app/firstdraft/issue/FIR-524/switch-rails-projects-to-postgres-and-implement-actual-db-schema-gem