Skip to content
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

Open
wants to merge 15 commits into
base: dev
Choose a base branch
from

Conversation

kukurudz-nadia
Copy link
Owner

No description provided.

<% @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') %>" />

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

перейменуй може файл)

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

перейменуй може файл)

index на show? чи ти маєш на увазі файл картинки?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

він про назву картинки))

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

він про назву картинки))
дякую, зміню

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed

Comment on lines 8 to 13
session[:cart] ||= []
end

def load_cart
#change where not find load products from cart
@cart = Product.find(session[:cart])
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

так стоп, стоп, стоп). Ти шукаєш продукт по масиву?) ще і для не авторизованого користувача?))

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

видалила

before_action :authenticate_user!

def create
def create; end
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

навіщо тут цей екшин? ти його юзаєш десь?

render
end
def index
render
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

а це що і навіщо?)

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

видалила

def index
@orders = Order.all
end
before_action :set_quote, only: [:show, :edit, :update, :destroy]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

що це таке?))

Copy link
Owner Author

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])
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ресурс?)

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

і для чого у тебе екшин едіта та апдейта замовлення?) на тій же розетці ти маєш таку можливість?)

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed

<% 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" %>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

компонента))

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed

<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" %>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

компонента)

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed


<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') %>"/>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

хелпер

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed

Comment on lines 3 to 8
<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>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

у тебе на всі сторінки, де є рендериться продукт для списку, має бути ТІЛЬКИ ОДИН ПАРШАЛ

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed

<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" %>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

компонента

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants