From cfe4674d3637c746cdb3c2b5131e2de498775529 Mon Sep 17 00:00:00 2001 From: Rikki Pitt Date: Fri, 4 Jan 2019 21:57:43 +0000 Subject: Update tag helper routes for use in engines (#49) When using the `rich_text_area_tag` form helper from within a Rails engine, the direct_upload_url and blob_url_template options would default to non-existent routes. By prefixing these routes with `main_app` we ensure the application root is used rather than the engine. --- app/helpers/action_text/tag_helper.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/helpers/action_text/tag_helper.rb b/app/helpers/action_text/tag_helper.rb index 0be2d2af36..837b2264b1 100644 --- a/app/helpers/action_text/tag_helper.rb +++ b/app/helpers/action_text/tag_helper.rb @@ -22,8 +22,8 @@ module ActionText options[:class] ||= "trix-content" options[:data] ||= {} - options[:data][:direct_upload_url] = rails_direct_uploads_url - options[:data][:blob_url_template] = rails_service_blob_url(":signed_id", ":filename") + options[:data][:direct_upload_url] = main_app.rails_direct_uploads_url + options[:data][:blob_url_template] = main_app.rails_service_blob_url(":signed_id", ":filename") editor_tag = content_tag("trix-editor", "", options) input_tag = hidden_field_tag(name, value, id: options[:input]) -- cgit v1.2.3