diff options
author | Rikki Pitt <rikkipitt@users.noreply.github.com> | 2019-01-04 21:57:43 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2019-01-04 13:57:43 -0800 |
commit | cfe4674d3637c746cdb3c2b5131e2de498775529 (patch) | |
tree | 9b8ccedad8e90174931ebe3db056658d44ebc707 | |
parent | f2a5c1a541342a886ed3de3b9a15ce06b6bdcde5 (diff) | |
download | rails-cfe4674d3637c746cdb3c2b5131e2de498775529.tar.gz rails-cfe4674d3637c746cdb3c2b5131e2de498775529.tar.bz2 rails-cfe4674d3637c746cdb3c2b5131e2de498775529.zip |
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.
-rw-r--r-- | app/helpers/action_text/tag_helper.rb | 4 |
1 files 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]) |