-
Notifications
You must be signed in to change notification settings - Fork 30
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
Create _essence_spree_product_view and _essence_spree_taxon_view when running installer #36
Comments
Those files live in this gem and will be picked up by Rails Template lookup if no such file exists in the host app. This said, are you sure you have a Taxon or product assigned in the backend? |
IMO the installer should copy the files to the user application. You have to dig in the gem code to understand that you have to create |
Ok, know I see the confusion. Sorry. I usually have the product rendering logic in my element that uses the # app/views/alchemy/product_teaser.html.erb
<%= element_view_for element do |el| %>
<% product = el.ingredient(:product) %>
Price: <%= product.display_price %>
...
<% end %> That way I can have multiple representations for the same product. The same is true for taxons. # app/views/alchemy/taxon_teaser.html.erb
<%= element_view_for element do |el| %>
<% taxon = el.ingredient(:taxon) %>
Products count: <%= taxon.products.count %>
...
<% end %> There is no advantage having this logic inside your essence product partials. That's why they are empty. Sorry, if that is not very obvious from the Readme. |
Got it, thanks. Might be a useful snippet to add to the readme. :) The You can haz Solidus product and taxons! section is not super clear about where |
@rickythefox yes, you are absolutely right. Thanks for reporting. Any chance you have time to provide a PR with that change? Maybe you have other things to add to the README as well that would help other newcomers? |
Of course, will submit a PR next week. |
Awesome. Thank you! |
@rickythefox updated the README in #46 and included the element examples |
Thank you! Completely forgot that I promised a PR, sorry about that! |
That’s fine. We all have other things to do :)
Is the example ok or can it be improved?
|
@tvdeyen I think the examples are great! Thanks for taking the time to write them. |
Shouldn't the installer create
app/views/alchemy/essences/_essence_spree_product_view.html.erb
andapp/views/alchemy/essences/_essence_spree_taxon_view.html.erb
and perhaps also add some dafaults (like
<%= content.ingredient.name %>
) to them?As it is, nothing is displayed when rendering the generated page, which is a bit confusing.
The text was updated successfully, but these errors were encountered: