From 9248773e4a896b34a5a290142909417e93847835 Mon Sep 17 00:00:00 2001 From: benji Date: Mon, 16 Jan 2017 23:47:48 +0100 Subject: [PATCH] Relative paths --- app/assets/javascripts/components/transaction_form.jsx.coffee | 2 +- app/views/layouts/application.html.haml | 2 ++ config/environments/production.rb | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/components/transaction_form.jsx.coffee b/app/assets/javascripts/components/transaction_form.jsx.coffee index 2aa6c24..56bc47f 100644 --- a/app/assets/javascripts/components/transaction_form.jsx.coffee +++ b/app/assets/javascripts/components/transaction_form.jsx.coffee @@ -184,7 +184,7 @@ Step = React.createFactory React.createClass div id: 'transaction-form', h3 null, 'Transfer some money' - form ref: 'form', action: '/transactions', acceptCharset: 'UTF-8', method: 'post', + form ref: 'form', action: "#{@window.base_url}/transactions", acceptCharset: 'UTF-8', method: 'post', Step step: 1, title: 'What do you want to do?', Action giving: giving, setAction: @setAction if step >= 2 diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 2c9e782..be6b403 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -7,6 +7,8 @@ = stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true = javascript_include_tag 'application', 'data-turbolinks-track' => true = csrf_meta_tags + :javascript + window.base_url = "#{Rails.application.config.relative_url_root}" %body .pure-g = render 'menu' if current_user diff --git a/config/environments/production.rb b/config/environments/production.rb index 5c1b32e..585d591 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -76,4 +76,5 @@ Rails.application.configure do # Do not dump schema after migrations. config.active_record.dump_schema_after_migration = false + config.relative_url_root = "/tab" end