Created
May 14, 2013 15:14
-
-
Save Jorshasaur/5576734 to your computer and use it in GitHub Desktop.
Example of how to pull in Taxons using erb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Spree::HomeController.class_eval do | |
helper 'spree/products' | |
respond_to :html | |
def index | |
@apikey = Settings.api_key | |
@taxons = Spree::Taxon.all | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The url from taxon.permalink 404's, but I think we altered the routes to break this.