VietTH: Feature display items
{{ resolvedDiscussionCount }}/{{ discussionCount }} {{ resolvedCountText }} resolved
Reassigned to @lannn
Reassigned to @giangttd
Reassigned to @lannn
Added 1 commit:
Added 1 commit:
| 1 | - items.each do |product| | |
Please
register
or
sign in
to reply
|
||
| 1 | - items.each do |product| | |
| 2 | .product-item.col-md-4.text-center | |
| 3 | .product-title | |
| 4 | = link_to product.title, product_path(product) | |
| 5 | .product-image.img-thumbnail | |
| 6 | %img{src: product.image_md_url} | |
|
||
| 1 | - items.each do |product| | |
| 2 | .product-item.col-md-4.text-center | |
| 3 | .product-title | |
| 4 | = link_to product.title, product_path(product) | |
|
||
| 1 | %li | |
| 2 | = link_to category.decorate.title, category_path(category) | |
|
||
| 1 | .module | |
| 2 | %h3.title Recommended Items | |
| 3 | .module | |
| 4 | #recommend-items | |
| 5 | = render '/categories/recommended', items: @recommended_items | |
|
||
| 4 | = stylesheet_link_tag 'application', media: 'all' | |
| 5 | = javascript_include_tag 'application' | |
| 6 | = csrf_meta_tags | |
| 7 | ||
| 8 | %body | |
| 9 | %nav.navbar.navbar-inverse.navbar-fixed-top | |
| 10 | .container-fluid | |
| 11 | = render '/layouts/header' | |
| 12 | ||
| 13 | #wrapper.container-fluid | |
| 14 | .row | |
| 15 | .col-md-6.search-wrapper | |
| 16 | = render '/layouts/search' | |
| 17 | .row | |
| 18 | .col-md-12 | |
| 19 | = render 'layouts/breadscrum' | |
|
||
| 1 | LIMIT_CATEGORY = 5 | |
|
||
| 1 | class CreateCategories < ActiveRecord::Migration | |
| 2 | def change | |
| 3 | create_table :categories do |t| | |
| 4 | t.timestamps null: false | |
| 5 | t.string :node_id | |
| 6 | t.string :title | |
|
||
| 1 | class Category < ActiveRecord::Base | |
| 2 | default_scope ->{ order(:title) } | |
|
||
| 1 | class Product < ActiveRecord::Base | |
| 2 | scope :recommended, ->{ self.offset(rand(self.count)).limit(LIMIT_PRODUCT_RECOMMENDED) } | |
|
||
Added 1 commit:
Added 1 commit:
Added 1 commit:
Added 1 commit:
Status changed to merged
Status changed to merged