RailsCasts Pro episodes are now free!

Learn more or hide this

ramya26's Profile

GitHub User: ramya26

Comments by

Avatar

Am using kaminari ajax pagination in my project. It is working fine, But contents are displaying number of pages times in the one page. For example if number of items per pages is 7, then it is displaying 7 times the same content (7 items). What am doing is

In product_details controller

  def index
    @products=ProductDetail.where("department_id = ? and category_id = ?",1, 1).page(params[:page]).per(15)
  end

In product_details/index.html.erb

<div id="product_details">
    <%= render @products %>
</div>
<div id="paginator">
    <%= paginate @products, :remote=>true %>
</div>

In product_details/index.js.erb

$('#product_details').html('<%= escape_javascript render (@products) %>');
$('#paginator').html('<%= escape_javascript(paginate(@products, :remote=>true).to_s)%>');

In product_details/_product_detail.html.erb

<div id="product_list">             
    <% @products.each do | product | %> 
        <div class="product_container">     
            <div class="product_box" >
                <div id="future_image_container">
                    <div class="image_block" >
                        <%= image_tag(product.image_path, :alt => "product image", :height=>"215px") %>
                    </div>
                    <span id="future_price" style="text-decoration: line-through; color: #9e9c9c;">
                        <span style="color: black;">
                            <%=  "$#{product.price}" %>
                        </span>
                    </span>
                    <div id="circle">
                        <p>
                            <% if(product.discount > 0) %>
                                <% new_price=((2.0*((product.price*product.discount)/100)).round)/2.0 %>
                            <% else %>
                                <% new_price=product.price %>
                            <% end %>
                            <%= "$#{new_price}"%>
                        </p>
                    </div>
                </div>
                <p class="future_product_name">
                    <%= product.name %>
                </p>
                <% @brands=Brand.where("id=?",product.brand_id)
                    @brands.each do |brand|
                        @brandname=brand.name
                    end
                %>
                <p class="future_product_name">
                    <%= "Brand : #{@brandname}" %>
                </p>
            </div>
        </div>
    <% end %>
</div>

Please help me to solve this problem

Avatar

Hi Ryan, I followed all the steps which is given in http://railscasts.com/episodes/209-introducing-devise. Sign up process is woking fine. Everything is getting stored in the database. But sign_in process is not working for valid users also. It is giving invalid email or password... Please help me...