Commit 079a8c34 by vulehuan

dynamic product category on sidebar

parent 45c469cd
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
// Place all the styles related to the ProductCategory controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
class ProductCategoryController < ApplicationController
def show
end
end
<% terms = ProductCategory.all %>
<!-- Product category --> <!-- Product category -->
<div class="box bg"> <div class="box bg">
<h2> <h2>
...@@ -6,15 +7,15 @@ ...@@ -6,15 +7,15 @@
class="sprite-1 corner-right"></span> class="sprite-1 corner-right"></span>
</h2> </h2>
<ul class="list"> <ul class="list">
<li><a href="" title="">Category 1</a></li> <%
<li><a href="" title="">Category 2</a></li> n = terms.count
<li><a href="" title="">Category 3</a></li> i = 1
<li><a href="" title="">Category 4</a></li> terms.each do |term|
<li><a href="" title="">Category 5</a></li> %>
<li><a href="" title="">Category 6</a></li> <li<%= %Q{ class="last">} if i == n %>><a href="<%= product_category_path(term) %>" title=""><%= term.name %></a></li>
<li><a href="" title="">Category 7</a></li> <%
<li><a href="" title="">Category 8</a></li> i += 1
<li><a href="" title="">Category 9</a></li> end
<li class="last"><a href="" title="">Category 10</a></li> %>
</ul> </ul>
</div> </div>
\ No newline at end of file
...@@ -48,7 +48,6 @@ ...@@ -48,7 +48,6 @@
</div> </div>
</div> </div>
<%= render 'layouts/footer' %> <%= render 'layouts/footer' %>
<%= debug(params) if Rails.env.development? %>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script> <script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
<%= javascript_include_tag "application", "data-turbolinks-track" => true %> <%= javascript_include_tag "application", "data-turbolinks-track" => true %>
......
...@@ -39,7 +39,6 @@ ...@@ -39,7 +39,6 @@
<%= yield %> <%= yield %>
</div> </div>
<%= render 'layouts/footer' %> <%= render 'layouts/footer' %>
<%= debug(params) if Rails.env.development? %>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script> <script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
<%= javascript_include_tag "application", "data-turbolinks-track" => true %> <%= javascript_include_tag "application", "data-turbolinks-track" => true %>
......
VenshopApp::Application.routes.draw do VenshopApp::Application.routes.draw do
resources :users resources :users
resources :sessions, only: [:new, :create, :destroy] resources :sessions, only: [:new, :create, :destroy]
resources :product_category
get "default_pages/home" get "default_pages/home"
get "users/new" get "users/new"
match '/testyahoo', to: 'users#testyahoo', via: 'get'
match '/signup', to: 'users#new', via: 'get' match '/signup', to: 'users#new', via: 'get'
match '/signin', to: 'sessions#new', via: 'get' match '/signin', to: 'sessions#new', via: 'get'
match '/signout', to: 'sessions#destroy', via: 'delete' match '/signout', to: 'sessions#destroy', via: 'delete'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment