From 3376a929f573d70b630b4db6bd7c285f2e41e99d Mon Sep 17 00:00:00 2001 From: jfederico Date: Mon, 17 Oct 2016 10:21:18 -0400 Subject: [PATCH] Statics landing page, first approach --- app/controllers/landing_controller.rb | 11 +++++++++ app/views/landing/index.html.erb | 35 ++++++++++++++++++++++++++- 2 files changed, 45 insertions(+), 1 deletion(-) diff --git a/app/controllers/landing_controller.rb b/app/controllers/landing_controller.rb index a5c04b4f..135fd099 100644 --- a/app/controllers/landing_controller.rb +++ b/app/controllers/landing_controller.rb @@ -1,4 +1,15 @@ class LandingController < ApplicationController def index + @meeting_token = params[:id] || @meeting_token = rand.to_s[2..10] + @meeting_url = meeting_url(@meeting_token) + end + + private + def meeting_url(meeting_token) + _meeting_url = "#{request.original_url}" + _meeting_url += "meeting" if ( request.original_url == "#{request.base_url}/" ) + _meeting_url += "/" unless _meeting_url.end_with?('/') + _meeting_url += "#{meeting_token}" if !params.has_key?(:id) + _meeting_url end end diff --git a/app/views/landing/index.html.erb b/app/views/landing/index.html.erb index ea27d33b..fed5c740 100644 --- a/app/views/landing/index.html.erb +++ b/app/views/landing/index.html.erb @@ -1,2 +1,35 @@

Landing#index

-

Find me in app/views/landing/index.html.erb

+
+

<%= @meeting_url %>

+
+ +
+
+ + +
+
+ +
+ + + + +
+

Hi Everyone

+
+

The meeting will be at this URL

+
+

<%= @meeting_url %>

+
+

Please join!

+
+
+ + + +