Commit eca25b69 by vulehuan

change entity name

parent 9443db4f
# 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 Card controller here.
// Place all the styles related to the Cards controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
// Place all the styles related to the Product controller here.
// Place all the styles related to the ProductCategories controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
// Place all the styles related to the ProductCategory controller here.
// Place all the styles related to the Products controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
// Place all the styles related to the Users controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
class CardController < ApplicationController
class CardsController < ApplicationController
def index
end
......
class ProductCategoryController < ApplicationController
def show
end
class ProductCategoriesController < ApplicationController
def show
end
end
class ProductController < ApplicationController
class ProductsController < ApplicationController
def index
end
......
class Product < ActiveRecord::Base
# Returns recommended products (order by rate, and available)
def self.get_recommended_products(options = { limit: 8 })
limit = options[:limit]
return Product.select('id, name, image_medium, price, price_currency').where(availability: 'instock').order('review_rate DESC').order('review_count DESC').limit(limit)
end
# Returns recommended products (order by rate, and available)
Please register or sign in to reply
def self.get_recommended_products(options = { limit: 8 })
limit = options[:limit]
return Product.select('id, name, image_medium, price, price_currency').where(availability: 'instock').order('review_rate DESC').order('review_count DESC').limit(limit)
end
# Returns newest products
def self.get_newest_products(options = { limit: 8 })
limit = options[:limit]
return Product.select('id, name, image_medium, price, price_currency').where(availability: 'instock').order('created_at DESC').order('updated_at DESC').order('name').limit(limit)
end
end
# Returns newest products
def self.get_newest_products(options = { limit: 8 })
limit = options[:limit]
return Product.select('id, name, image_medium, price, price_currency').where(availability: 'instock').order('created_at DESC').order('updated_at DESC').order('name').limit(limit)
end
end
\ No newline at end of file
class ProductCategory < ActiveRecord::Base
end
end
\ No newline at end of file
<h1>Card#checkout</h1>
<p>Find me in app/views/card/checkout.html.erb</p>
<h1>Card#confirm_checkout</h1>
<p>Find me in app/views/card/confirm_checkout.html.erb</p>
<h1>Card#index</h1>
<p>Find me in app/views/card/index.html.erb</p>
<h1>Card#thankyou</h1>
<p>Find me in app/views/card/thankyou.html.erb</p>
<h1>Cards#checkout</h1>
<p>Find me in app/views/cards/checkout.html.erb</p>
<h1>Cards#confirm_checkout</h1>
<p>Find me in app/views/cards/confirm_checkout.html.erb</p>
<h1>Cards#index</h1>
<p>Find me in app/views/cards/index.html.erb</p>
<h1>Cards#thankyou</h1>
<p>Find me in app/views/cards/thankyou.html.erb</p>
<h1>Product#index</h1>
<p>Find me in app/views/product/index.html.erb</p>
<h1>Product#show</h1>
<p>Find me in app/views/product/show.html.erb</p>
<h1>ProductCategories#show</h1>
<p>Find me in app/views/product_categories/show.html.erb</p>
<h1>Products#index</h1>
<p>Find me in app/views/products/index.html.erb</p>
<h1>Products#show</h1>
<p>Find me in app/views/products/show.html.erb</p>
VenshopApp::Application.routes.draw do
get "card/index"
get "card/checkout"
get "card/confirm_checkout"
get "card/thankyou"
get "product/index"
get "product/show"
get "product_categories/show"
get "products/index"
get "products/show"
get "cards/index"
get "cards/checkout"
get "cards/confirm_checkout"
get "cards/thankyou"
resources :users
resources :sessions, only: [:new, :create, :destroy]
resources :product_categories
resources :products
resources :cards
resources :product_categogies
get "default_pages/home"
get "users/new"
match '/signup', to: 'users#new', via: 'get'
......
require 'spec_helper'
describe ProductCategory do
describe ProductCategories do
pending "add some examples to (or delete) #{__FILE__}"
end
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