FAQ
inside: /app/views/spree/home/index/html.erb, i added a render partial, to
get all the homepage products. but is i get an error:


undefined method `empty?' for nil:NilClass


but the partial is going to the core gem, right? and its works perfectly
without adding the spree_fancy theme.




<div id="welcome-message">

   <div class="container span12">

     <h1>

       Welcome to our amazing store!

       <br>

       Choose <a href="/products">anything</a> you wish, we’ll ship it <a
href="/products">anywhere!</a>

     </h1>

   </div>

</div>

<div class="container">

<div class="span4">


</div>


<div class="span8">


   <% if @featured_products %>

     <div id="featured-products" class="row">

       <h3>Featured Products</h3>

       <hr>

       <ul class="carousel">

         <% @featured_products.each do |product| %>

           <%= render 'product', :product => product %>

         <% end %>

       </ul>

     </div>

   <% end %>


   <% if @latest_products %>

     <div id="latest-products" class="row">

       <h3>Latest Products</h3>

       <hr>

       <ul class="carousel">

         <% @latest_products.each do |product| %>

           <%= render 'product', :product => product %>

         <% end %>

       </ul>

     </div>

   <% end %>



   <div data-hook="homepage_products">

   <%= render :partial => 'spree/shared/products', :locals => { :products =>
@products } %>

</div>



</div>

</div>

--
Don't miss SpreeConf on May 20-21: http://spreeconf.com
Spree is hiring: http://spreecommerce.com/careers

Search Discussions

  • Ryan Bigg at May 5, 2013 at 11:48 pm
    Abdullah,

    Please provide exact steps to reproduce this issue. Without these, we have
    absolutely no way of knowing how to reproduce the issue on our machines and
    therefore we cannot fix it.

    On Fri, May 3, 2013 at 5:52 AM, Abdullah jeffers wrote:

    inside: /app/views/spree/home/index/html.erb, i added a render partial, to
    get all the homepage products. but is i get an error:


    undefined method `empty?' for nil:NilClass


    but the partial is going to the core gem, right? and its works perfectly
    without adding the spree_fancy theme.




    <div id="welcome-message">

    <div class="container span12">

    <h1>

    Welcome to our amazing store!

    <br>

    Choose <a href="/products">anything</a> you wish, we’ll ship it <a
    href="/products">anywhere!</a>

    </h1>

    </div>

    </div>

    <div class="container">

    <div class="span4">


    </div>


    <div class="span8">


    <% if @featured_products %>

    <div id="featured-products" class="row">

    <h3>Featured Products</h3>

    <hr>

    <ul class="carousel">

    <% @featured_products.each do |product| %>

    <%= render 'product', :product => product %>

    <% end %>

    </ul>

    </div>

    <% end %>


    <% if @latest_products %>

    <div id="latest-products" class="row">

    <h3>Latest Products</h3>

    <hr>

    <ul class="carousel">

    <% @latest_products.each do |product| %>

    <%= render 'product', :product => product %>

    <% end %>

    </ul>

    </div>

    <% end %>



    <div data-hook="homepage_products">

    <%= render :partial => 'spree/shared/products', :locals => { :products
    => @products } %>

    </div>



    </div>

    </div>

    --
    Don't miss SpreeConf on May 20-21: http://spreeconf.com
    Spree is hiring: http://spreecommerce.com/careers



    --

    Ryan Bigg
    Community Manager
    Spree Commerce, Inc.

    Register now for SpreeConf
    May 20-21 in Washington, D.C.
    http://spreeconf.com

    --
    Don't miss SpreeConf on May 20-21: http://spreeconf.com
    Spree is hiring: http://spreecommerce.com/careers
  • Abdullah jeffers at May 6, 2013 at 12:53 am
    1. Added gem spree_fancy stable 1.3 to a clean 1.3.2 release of spree gem.

    2. Added the following code in app below to /app/views/spree/home/index/html.erb,
    so that underneath @featured_products that spree_fancy controllers uses, i
    can list all the homepage products, with a similar layout like an install
    without the theme applied.

       <div data-hook="homepage_products">

       <%= render :partial => 'spree/shared/products', :locals => { :products =>
    @products } %>

    </div>


    the virtual path 'spree/shared/products/, has no overrides, del, or defaces
    in the spree_fancy theme. so i checked the core spree 1.3.2 and the paths
    were correct, i just get an error:: undefined method `empty?' for
    nil:NilClass.

    --
    Don't miss SpreeConf on May 20-21: http://spreeconf.com
    Spree is hiring: http://spreecommerce.com/careers
  • Abdullah jeffers at May 6, 2013 at 12:55 am
    source 'https://rubygems.org'


    gem 'rails', '3.2.13'


    # Bundle edge Rails instead:

    # gem 'rails', :git => 'git://github.com/rails/rails.git'


    gem 'sqlite3'



    # Gems used only for assets and not required

    # in production environments by default.

    group :assets do

       gem 'sass-rails', '~> 3.2.3'

       gem 'coffee-rails', '~> 3.2.1'


       # See https://github.com/sstephenson/execjs#readme for more supported
    runtimes

       # gem 'therubyracer', :platforms => :ruby


       gem 'uglifier', '>= 1.0.3'

    end


    gem 'jquery-rails'


    # To use ActiveModel has_secure_password

    # gem 'bcrypt-ruby', '~> 3.0.0'


    # To use Jbuilder templates for JSON

    # gem 'jbuilder'


    # Use unicorn as the app server

    # gem 'unicorn'


    # Deploy with Capistrano

    # gem 'capistrano'


    # To use debugger

    # gem 'debugger'

    gem 'spree', '1.3.2'

    gem 'spree_gateway', :github => 'spree/spree_gateway', :branch =>
    '1-3-stable'

    gem 'spree_auth_devise', :github => 'spree/spree_auth_devise', :branch =>
    '1-3-stable'


    #gem 'spree_fab', :git => 'git://github.com/stunjiturner/spree_fab.git'


    gem 'spree_fancy', :git => 'git://github.com/spree/spree_fancy.git',
    :branch => '1-3-stable'



    forgot the gem file i am using
    On Thursday, May 2, 2013 3:52:08 PM UTC-4, Abdullah jeffers wrote:

    inside: /app/views/spree/home/index/html.erb, i added a render partial, to
    get all the homepage products. but is i get an error:


    undefined method `empty?' for nil:NilClass


    but the partial is going to the core gem, right? and its works perfectly
    without adding the spree_fancy theme.




    <div id="welcome-message">

    <div class="container span12">

    <h1>

    Welcome to our amazing store!

    <br>

    Choose <a href="/products">anything</a> you wish, we’ll ship it <a
    href="/products">anywhere!</a>

    </h1>

    </div>

    </div>

    <div class="container">

    <div class="span4">


    </div>


    <div class="span8">


    <% if @featured_products %>

    <div id="featured-products" class="row">

    <h3>Featured Products</h3>

    <hr>

    <ul class="carousel">

    <% @featured_products.each do |product| %>

    <%= render 'product', :product => product %>

    <% end %>

    </ul>

    </div>

    <% end %>


    <% if @latest_products %>

    <div id="latest-products" class="row">

    <h3>Latest Products</h3>

    <hr>

    <ul class="carousel">

    <% @latest_products.each do |product| %>

    <%= render 'product', :product => product %>

    <% end %>

    </ul>

    </div>

    <% end %>



    <div data-hook="homepage_products">

    <%= render :partial => 'spree/shared/products', :locals => { :products
    => @products } %>

    </div>



    </div>

    </div>
    --
    Don't miss SpreeConf on May 20-21: http://spreeconf.com
    Spree is hiring: http://spreecommerce.com/careers
  • Abdullah jeffers at May 7, 2013 at 3:55 pm
    The problem occurs when using the virtual path
    /app/controllers/spree/home_controller_decorator.rb. there is no @products
    for the index method.?

    On Sunday, May 5, 2013 8:55:41 PM UTC-4, Abdullah jeffers wrote:

    source 'https://rubygems.org'


    gem 'rails', '3.2.13'


    # Bundle edge Rails instead:

    # gem 'rails', :git => 'git://github.com/rails/rails.git'


    gem 'sqlite3'



    # Gems used only for assets and not required

    # in production environments by default.

    group :assets do

    gem 'sass-rails', '~> 3.2.3'

    gem 'coffee-rails', '~> 3.2.1'


    # See https://github.com/sstephenson/execjs#readme for more supported
    runtimes

    # gem 'therubyracer', :platforms => :ruby


    gem 'uglifier', '>= 1.0.3'

    end


    gem 'jquery-rails'


    # To use ActiveModel has_secure_password

    # gem 'bcrypt-ruby', '~> 3.0.0'


    # To use Jbuilder templates for JSON

    # gem 'jbuilder'


    # Use unicorn as the app server

    # gem 'unicorn'


    # Deploy with Capistrano

    # gem 'capistrano'


    # To use debugger

    # gem 'debugger'

    gem 'spree', '1.3.2'

    gem 'spree_gateway', :github => 'spree/spree_gateway', :branch =>
    '1-3-stable'

    gem 'spree_auth_devise', :github => 'spree/spree_auth_devise', :branch =>
    '1-3-stable'


    #gem 'spree_fab', :git => 'git://github.com/stunjiturner/spree_fab.git'


    gem 'spree_fancy', :git => 'git://github.com/spree/spree_fancy.git',
    :branch => '1-3-stable'



    forgot the gem file i am using
    On Thursday, May 2, 2013 3:52:08 PM UTC-4, Abdullah jeffers wrote:

    inside: /app/views/spree/home/index/html.erb, i added a render partial,
    to get all the homepage products. but is i get an error:


    undefined method `empty?' for nil:NilClass


    but the partial is going to the core gem, right? and its works perfectly
    without adding the spree_fancy theme.




    <div id="welcome-message">

    <div class="container span12">

    <h1>

    Welcome to our amazing store!

    <br>

    Choose <a href="/products">anything</a> you wish, we’ll ship it <a
    href="/products">anywhere!</a>

    </h1>

    </div>

    </div>

    <div class="container">

    <div class="span4">


    </div>


    <div class="span8">


    <% if @featured_products %>

    <div id="featured-products" class="row">

    <h3>Featured Products</h3>

    <hr>

    <ul class="carousel">

    <% @featured_products.each do |product| %>

    <%= render 'product', :product => product %>

    <% end %>

    </ul>

    </div>

    <% end %>


    <% if @latest_products %>

    <div id="latest-products" class="row">

    <h3>Latest Products</h3>

    <hr>

    <ul class="carousel">

    <% @latest_products.each do |product| %>

    <%= render 'product', :product => product %>

    <% end %>

    </ul>

    </div>

    <% end %>



    <div data-hook="homepage_products">

    <%= render :partial => 'spree/shared/products', :locals => { :products
    => @products } %>

    </div>



    </div>

    </div>
    --
    Don't miss SpreeConf on May 20-21: http://spreeconf.com
    Spree is hiring: http://spreecommerce.com/careers

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupspree-user @
categoriesrubyonrails
postedMay 2, '13 at 7:53p
activeMay 7, '13 at 3:55p
posts5
users2
websitespreecommerce.com
irc#RubyOnRails

2 users in discussion

Abdullah jeffers: 4 posts Ryan Bigg: 1 post

People

Translate

site design / logo © 2022 Grokbase