You have done most part of the homework, really appreciate your work
Goals of this homework:
Learn how to define root path and custom paths. Use _path methods in controller and view files
Use ActiveRecord querying with .where
Create multiple ActiveRecord models with different types of columns
Sort items by using ActiveRecord's .order method (reference here)
Use ActionController's Flash to display success or failure notices (reference here)
Great stuffs:
You look confident using order and where, really awesome stuffs
Good use of validation, nice job man
Good use of flash
You know this working ActionController::Base.helpers.number_to_currency, but I would suggest creating a method in helper. For example in app/helpers/food_items_helper.rb, you can creat a method:
module FoodItemsHelper
def format_food_price(price)
number_to_currency(price, precision: 0, unit: "VND", separator: ",", format: "%n %u")
end
end
Suggestions:
I suggest you spend time on optional issues, they will really bring you to the next levels
You have done most part of the homework, really appreciate your work
Goals of this homework:
Great stuffs:
order
andwhere
, really awesome stuffsflash
You know this working
ActionController::Base.helpers.number_to_currency
, but I would suggest creating a method in helper. For example inapp/helpers/food_items_helper.rb
, you can creat a method:Suggestions: