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

Using Handlebars inside of Rails methods #96

Closed
mtmcfarl opened this issue Apr 21, 2014 · 2 comments
Closed

Using Handlebars inside of Rails methods #96

mtmcfarl opened this issue Apr 21, 2014 · 2 comments

Comments

@mtmcfarl
Copy link

I think my question is potentially related to #95 and #89 but I'll ask it anyways.

I have a Handlebars view and I'd like to access the data and include it inside of a Rails method like so

<%= image_tag "adBuilder/templates/{{template.gender}}/template-0{{template.template}}-large.png", class: "" %>

I'd want the above line of code to resolve to

<img src="adBuilder/templates/male/template-01-large.png" />

Of course with the Rails fingerprinting from the asset pipeline.

Am I doing something wrong or is this not supported yet?

@mtmcfarl
Copy link
Author

Update, the code does resolve the template data like it should. However the image_tag puts /images in front of the URL instead of /assets.

@bcackerman
Copy link

One thing to note is to make sure you have alt set to something. Even alt: ""

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