Skip to content

Commit 19dc728

Browse files
fix: close signups
1 parent 052947f commit 19dc728

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

app/controllers/landing_controller.rb

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,17 @@ def index
2828
def sign_up
2929
email = params.require(:email).downcase
3030
ref = params[:ref]
31-
31+
# flash error "signups are closed"
32+
respond_to do |format|
33+
format.html { redirect_to request.referer || projects_path, alert: "Signups are closed" }
34+
format.json { render json: { ok: false, error: "Signups are closed" }, status: :service_unavailable }
35+
format.turbo_stream do
36+
flash.now[:alert] = "Signups are closed"
37+
render turbo_stream: turbo_stream.update("flash-container", partial: "shared/flash"),
38+
status: :service_unavailable
39+
end
40+
end
41+
return
3242
unless email.match?(URI::MailTo::EMAIL_REGEXP)
3343
return respond_to do |format|
3444
format.html { redirect_to request.referer || projects_path, alert: "Invalid email format" }

app/views/landing/index.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
Build stuff. Get stuff. <span class="font-bold text-som-orange">Repeat.</span>
3131
</h2>
3232
<div class="flex flex-col self-stretch sm:flex-row gap-3">
33-
<%= render "signup" %>
33+
<%# render "signup" #%>
3434
</div>
3535
<div class="flex flex-col items-center mx-auto">
3636
<p class="font-['Fredoka',sans-serif] font-normal mb-1 -mx-2 text-lg sm:text-xl self-center text-[#3a2f25 relative">

0 commit comments

Comments
 (0)