-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
implemented some expert's recommendation #21
base: dev
Are you sure you want to change the base?
Conversation
app/views/products/index.html.erb
Outdated
<% @products.each do |product| %> | ||
<div class="w-full max-w-sm bg-amber-100 border border-gray-200 rounded-lg shadow dark:bg-gray-800 dark:border-gray-700"> | ||
<div class="px-5 pb-5"> | ||
<img class="p-8 rounded-t-lg" src="<%= image_path('2_e822dae0-14df-4cb8-b145-ea4dc0966b34.webp') %>" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
перейменуй може файл)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
перейменуй може файл)
index на show? чи ти маєш на увазі файл картинки?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
він про назву картинки))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
він про назву картинки))
дякую, зміню
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed
* changed has_and_belongs_to_many on has_many through relationships * deleted helpers
added layaout for products
session[:cart] ||= [] | ||
end | ||
|
||
def load_cart | ||
#change where not find load products from cart | ||
@cart = Product.find(session[:cart]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
так стоп, стоп, стоп). Ти шукаєш продукт по масиву?) ще і для не авторизованого користувача?))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
видалила
app/controllers/carts_controller.rb
Outdated
before_action :authenticate_user! | ||
|
||
def create | ||
def create; end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
навіщо тут цей екшин? ти його юзаєш десь?
app/controllers/home_controller.rb
Outdated
render | ||
end | ||
def index | ||
render |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
а це що і навіщо?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
видалила
app/controllers/orders_controller.rb
Outdated
def index | ||
@orders = Order.all | ||
end | ||
before_action :set_quote, only: [:show, :edit, :update, :destroy] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
що це таке?))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed
def index | ||
@orders = Order.all | ||
end | ||
before_action :set_quote, only: [:show, :edit, :update, :destroy] | ||
|
||
def show | ||
@order = Order.find(params[:id]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ресурс?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
і для чого у тебе екшин едіта та апдейта замовлення?) на тій же розетці ти маєш таку можливість?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed
app/views/home/index.html.erb
Outdated
<% end %> | ||
<%= link_to new_user_session_path do %> | ||
<% if user_signed_in? %> | ||
<%= button_to "Log out", destroy_user_session_path, method: :delete, class:"relative inline-flex items-center justify-center p-0.5 mb-2 mr-2 overflow-hidden text-sm font-medium text-gray-900 rounded-lg group bg-gradient-to-br from-teal-300 to-lime-300 group-hover:from-teal-300 group-hover:to-lime-300 dark:text-white dark:hover:text-gray-900 focus:ring-4 focus:outline-none focus:ring-lime-200 dark:focus:ring-lime-800 relative px-5 py-2.5 transition-all ease-in duration-75 bg-white dark:bg-gray-900 rounded-md group-hover:bg-opacity-0" %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
компонента))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed
app/views/categories/show.html.erb
Outdated
<svg aria-hidden="true" class="w-5 h-5 text-yellow-300" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><title>Fifth star</title><path d="M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z"></path></svg> | ||
<span class="bg-blue-100 text-blue-800 text-xs font-semibold mr-2 px-2.5 py-0.5 rounded dark:bg-blue-200 dark:text-blue-800 ml-3">5.0</span> | ||
</div> | ||
<br> | ||
<%= button_to "Add to cart", add_to_cart_path(product), class: "text-white bg-gradient-to-r from-green-400 via-green-500 to-green-600 hover:bg-gradient-to-br focus:ring-4 focus:outline-none focus:ring-green-300 dark:focus:ring-green-800 font-medium rounded-lg text-sm px-5 py-2.5 text-center mr-2 mb-2" %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
компонента)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed
app/views/categories/show.html.erb
Outdated
|
||
<div class="w-full max-w-sm bg-amber-100 border border-gray-200 rounded-lg shadow dark:bg-gray-800 dark:border-gray-700"> | ||
<div class="px-5 pb-5"> | ||
<img class="p-8 rounded-t-lg" src="<%= image_path('2_e822dae0-14df-4cb8-b145-ea4dc0966b34.webp') %>"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
хелпер
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed
app/views/categories/show.html.erb
Outdated
<div class="w-full max-w-sm bg-amber-100 border border-gray-200 rounded-lg shadow dark:bg-gray-800 dark:border-gray-700"> | ||
<div class="px-5 pb-5"> | ||
<img class="p-8 rounded-t-lg" src="<%= image_path('2_e822dae0-14df-4cb8-b145-ea4dc0966b34.webp') %>"/> | ||
<p class="py-2.5 text-2xl font-bold w-4/5 mx-auto"><%= product.name %></p> | ||
<p class="py-2.5 font-normal text-xl text-gray-700"><%= product.description %></p> | ||
<p class="flex items-center justify-between text-3xl font-bold text-gray-900 dark:text-white"><%= product.price %>$<p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
у тебе на всі сторінки, де є рендериться продукт для списку, має бути ТІЛЬКИ ОДИН ПАРШАЛ
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed
app/views/categories/index.html.erb
Outdated
<div class="my-7 text-center mx-5 bg-amber-100 py-3 inline-flex flex-col rounded-lg shadow flex-wrap w-80 h-44"> | ||
<p class="py-3 text-xl font-bold w-2/5 m-auto"><%= category.name %></p> | ||
<p class="py-3 text-sm w-2/5 m-auto"><%= category.description %></p> | ||
<%= link_to "Show", category, class: "text-white h-14 bg-gradient-to-r from-green-400 via-green-500 to-green-600 hover:bg-gradient-to-br focus:ring-4 focus:outline-none focus:ring-green-300 dark:focus:ring-green-800 font-medium rounded-lg text-xl px-3 py-4 text-center mr-3 mb-2" %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
компонента
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed
No description provided.