Skip to content

Instantly share code, notes, and snippets.

@Jorshasaur
Created May 14, 2013 15:14
Show Gist options
  • Save Jorshasaur/5576734 to your computer and use it in GitHub Desktop.
Save Jorshasaur/5576734 to your computer and use it in GitHub Desktop.
Example of how to pull in Taxons using erb
Spree::HomeController.class_eval do
helper 'spree/products'
respond_to :html
def index
@apikey = Settings.api_key
@taxons = Spree::Taxon.all
end
end
<div class="row home">
<header class="large-12 columns"></header>
<div class="hero"></div>
<div class="item large-4 columns right-border"></div>
<div class="item large-8 columns"></div>
<div class="item large-12 columns"></div>
</div>
<ul>
<% @taxons.each do | taxon | %>
<li><a href="<%= taxon.permalink %>"><%= taxon.pretty_name %></a></li>
<% end %>
</ul>
@Jorshasaur
Copy link
Author

The url from taxon.permalink 404's, but I think we altered the routes to break this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment