Skip to content

Commit

Permalink
Merge pull request #45 from prakashmurthy/master
Browse files Browse the repository at this point in the history
Fix undefined method 'find_asset' for nil:NilClass error
  • Loading branch information
modsognir committed Jan 27, 2016
2 parents 27fc275 + cca470a commit 7526cbe
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/princely/asset_support.rb
Expand Up @@ -16,6 +16,7 @@ def localize_html_string(html_string, asset_path = nil)

def asset_file_path(asset)
# Remove /assets/ from generated names and try and find a matching asset
Rails.application.assets ||= Sprockets::Environment.new
Rails.application.assets.find_asset(asset.gsub(%r{/assets/}, "")).try(:pathname) || asset
end
end
Expand Down

0 comments on commit 7526cbe

Please sign in to comment.