Commit b6d73d1a by Dao Minh Nhut

fix import product

parent f56eb516
...@@ -8,9 +8,6 @@ VenShop::Application.routes.draw do ...@@ -8,9 +8,6 @@ VenShop::Application.routes.draw do
get '/help', to: 'static_pages#help' get '/help', to: 'static_pages#help'
get '/about', to: 'static_pages#about' get '/about', to: 'static_pages#about'
get '/contact', to: 'static_pages#contact' get '/contact', to: 'static_pages#contact'
get '/signup', to: 'users#new'
get '/signin', to: 'sessions#new'
# match '/signout', to: 'sessions#destroy', via: :delete
# match '/categories/:id', to: 'categories#show' # match '/categories/:id', to: 'categories#show'
# match '/items/:id', to: 'items#show' # match '/items/:id', to: 'items#show'
# match '/user/add_to_cart/:id', to: 'users#add_to_cart' # match '/user/add_to_cart/:id', to: 'users#add_to_cart'
......
...@@ -11,7 +11,7 @@ class Amazon ...@@ -11,7 +11,7 @@ class Amazon
@item_pages = (1..10).to_a @item_pages = (1..10).to_a
end end
private public
def import_product(item) def import_product(item)
begin begin
...@@ -44,5 +44,5 @@ class Amazon ...@@ -44,5 +44,5 @@ class Amazon
end end
end end
end end
end end
\ No newline at end of file
namespace :products do namespace :products do
desc 'Get products' desc 'Get products'
task import: :environment do task import: :environment do
Amazon.new.import Amazon.new.import_product
end
end end
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