Open coderschoolreview opened 8 years ago
Thanks you so much for your suggestion. I will do better in next homeworks.
2016-07-11 11:59 GMT+07:00 coderschoolreview notifications@github.com:
Thank for your submission. 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 http://guides.rubyonrails.org/active_record_querying.html#ordering).
- Use ActionController's Flash to display success or failure notices (reference here http://guides.rubyonrails.org/action_controller_overview.html#the-flash ).
- Learn about associations between Active Record models http://edgeguides.rubyonrails.org/association_basics.html on has_many and belong_to.
Great stuff:
- Nice validation code on food_item.rb model.
- You look confident using where and order, happy to see these lines of code.
Suggestions:
- You should validate for order form too.
- You should add associations between food_item.rb and order.rb models.
- Column food_item https://github.com/hongtran/restaurant/blob/master/db/migrate/20160710042605_create_orders.rb#L5 should be food_item_id, it's the best practice for the association.
- I think you should take time looking at this https://github.com/bbatsov/ruby-style-guide to improve readability of code.
- You should do more on code formatting, for example you should refactor home_controller.rb to something like this:
class HomeController < ApplicationController def index end
def menu ... end
def contact_us endend
Overall, it's a good submission. But if you have time, try to do some optional features, it's good for your learning. Please keep it up 💃
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/hongtran/restaurant/issues/1, or mute the thread https://github.com/notifications/unsubscribe/AHpp_VbhVMRAU69vRcEIaLq2SqAnCCRvks5qUc27gaJpZM4JJCDp .
Thank for your submission.
Goals of this homework:
_path
methods in controller and view files..where
..order
method (reference here).has_many
andbelong_to
.Great stuff:
food_item.rb
model.where
andorder
, happy to see these lines of code.Suggestions:
food_item.rb
andorder.rb
models.food_item
should befood_item_id
, it's the best practice for the association.home_controller.rb
to something like this:Overall, it's a good submission. But if you have time, try to do some optional features, it's good for your learning. Please keep it up :dancer: