Re: [spree-user] I dream of a better template system

53 views
Skip to first unread message

Peter Berkenbosch

unread,
Sep 11, 2012, 3:19:33 AM9/11/12
to spree...@googlegroups.com
We have a thing called erb?

But, for real.. what you want can be done with erb templates, and deface.. very very easy even.. you can override a complete template with deface..and use erb for that..


On Sep 9, 2012, at 7:47 AM, Pepper <zee....@gmail.com> wrote:

Hi Spree devs, please take a look what Forward is doing: http://getfwd.com/. That template system is exactly what we need - similar to liquid but with much richer syntax. The current deface approach is quick to get a store up and running, but it becomes useless once we start doing more customization. We need something like liquid but better. Please take a good long look at Forward, because that's exactly what we need. Thanks!

--
You received this message because you are subscribed to the Google Groups "Spree" group.
To view this discussion on the web visit https://groups.google.com/d/msg/spree-user/-/9Mue6BBSAyUJ.
To post to this group, send email to spree...@googlegroups.com.
To unsubscribe from this group, send email to spree-user+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/spree-user?hl=en.

Weston Platter

unread,
Sep 11, 2012, 4:38:00 PM9/11/12
to spree...@googlegroups.com, peterber...@me.com
@Pepper - the same type of functionality can be achived through Controller and View (ERB) code. How you implemented this? If yes, how would you want to change it to be more like Forward?

Forward combines the Controller and View functionality together. Thus making it easier in some senes, but it may make more complex actions difficult. Why I think this. http://getfwd.com/

{get $products from "/products" [search => $params.query]}


Here's how I would do this with Spree // Rails // ERB

# products_controller.rb
SimpleProducts < ApplicationController
  def show
    @products = Spree::Product.all
    
    render_to do |format| 
      format.html
      format.json { render json: @products}
    end
  end
end

# app/views/simple_products/show.html.erb
<% @products.each do |p| %>
  <%= p.name %>
<% end %>
Reply all
Reply to author
Forward
0 new messages