From caf8b0fc77e8d5fd5a30adbc89b6eb4ccf145625 Mon Sep 17 00:00:00 2001 From: Thomas <122806804+thomas-xza@users.noreply.github.com> Date: Mon, 22 Jul 2024 16:37:02 +0000 Subject: [PATCH] Toggled boolean in development.rb to allow comments to work with Github Codespaces - https://github.com/github/codespaces-rails/issues/37 --- rails_app/app/views/projects/show.html.erb | 12 +++--------- rails_app/config/environments/development.rb | 5 +++++ 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/rails_app/app/views/projects/show.html.erb b/rails_app/app/views/projects/show.html.erb index 6898cef..8411d0c 100644 --- a/rails_app/app/views/projects/show.html.erb +++ b/rails_app/app/views/projects/show.html.erb @@ -1,3 +1,4 @@ +

<%= @project.title %>

Project creator: <%= @project.creator %>

@@ -5,9 +6,6 @@

Project status: <%= @project.status %>

- -

Add a comment:

- <%= form_with model: [ @project, @project.comments.build ] do |form| %>

@@ -34,12 +32,8 @@ <% @project.comments.each do |comment| %>

- Commenter: - <%= comment.creator %> -

- -

- Comment: + <%= comment.creator %> +
<%= comment.body %>

<% end %> diff --git a/rails_app/config/environments/development.rb b/rails_app/config/environments/development.rb index 2e7fb48..e03df92 100644 --- a/rails_app/config/environments/development.rb +++ b/rails_app/config/environments/development.rb @@ -1,6 +1,11 @@ require "active_support/core_ext/integer/time" Rails.application.configure do + + ## For Github Codespaces + config.action_controller.forgery_protection_origin_check = false + + # Settings specified here will take precedence over those in config/application.rb. # In the development environment your application's code is reloaded any time