Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Manifest hash is empty #7

Open
amitfriedman12 opened this issue Dec 13, 2015 · 1 comment
Open

Manifest hash is empty #7

amitfriedman12 opened this issue Dec 13, 2015 · 1 comment

Comments

@amitfriedman12
Copy link

Hello.

I'm trying to use your gem in order to reference a jpg file I have in my assets folder.
Specifically:

assets/images/my_folder/1.jpg

So for instance when I copy this path to the browser:
http://localhost.com:3002/assets/my_folder/1.jpg
I get a valid image displayed.

However when I use your image tag helper:
image_tag("my_folder/1.jpg")

I get an error being raised in the asset_path method:

function asset_path(path){
    if(manifest.hasOwnProperty(path)){
      return '/assets/' + manifest[path];
    }
    else{
      throw Error('missing asset: ' + path);
    }
  };

actually, manifest seems to get instantiated to be an empty js object {}, so of course manifest.hasOwnProperty(path) will return false.

Am I missing something here?
Are there any additional setup steps I must take?

Your help will be greatly appreciated.
Thanks you

@johnnypez
Copy link
Owner

Hey,
I stopped maintaining this gem a long time ago and I just don't have any time to look at this right now. It was written for Rails ~3.2 so any changes in later versions might have broken the gem.

If you want to take a look into it yourself, fork the repo and add a line to print out any assets that are found here: https://github.com/johnnypez/assets_js/blob/master/app/assets/javascripts/assets_js.js.erb#L24 and work your way from there.

John

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

No branches or pull requests

2 participants