Skip to content
This repository was archived by the owner on Mar 7, 2019. It is now read-only.

Respect custom root path #19

Open
wants to merge 3 commits into
base: sass-rails-5.0.0.beta1
Choose a base branch
from

Conversation

JaycobA
Copy link

@JaycobA JaycobA commented Mar 6, 2015

  • sourcemaps working (rails 4.1)
  • respect relative_root_url setting
  • inherit from Sass::Rails to enable globbing

@vhyza
Copy link
Owner

vhyza commented Mar 17, 2015

Hello @JaycobA. I'm terribly sorry for the delay.

Unfortunately it's not working for rails 4.2. It seems Rails.configuration.relative_url_root is nil in new rails 4.2 project.

def public_url(uri, sourcemap_dir = nil)
source_maps_directory = sourcemap_dir ? sourcemap_dir.sub(Rails.root.join('public').to_s, '') : "/#{SOURCE_MAPS_DIRECTORY}"
"#{source_maps_directory}/#{File.basename(uri)}"
url_root = Rails.configuration.relative_url_root.chomp('/')
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably have some default when Rails.configuration.relative_url_root is not set.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants