study-coders-school-zen-restaurant's People
study-coders-school-zen-restaurant's Issues
Thanks!
Hi @hnanhquoc, congrats on your first homework submission!
Goals of this homework:
- Learn how to define root path, paths generated by RESTful resources and custom paths.
- Use _path methods in controller and view files
- Use ActiveRecord querying with .where and chain multiple .where queries when applicable.
- Create multiple ActiveRecord models with different types of columns (string, text, date, decimal)
- Define belongs_to and has_many between models
- Sort items by using ActiveRecord's .order method (http://guides.rubyonrails.org/active_record_querying.html#ordering). Chain with .where query.
- Use ActionController's Flash (http://guides.rubyonrails.org/action_controller_overview.html#the-flash) to display success or failure notices
Nice things we see:
- Good use of nested resources in config/routes.rb
- Clean application.html.erb layout file with a good use of partials.
- Use bootstrap class names appropriately, should try to add styling in css files instead of inline styling.
- Use validations in models
- Use of belongs_to/has_many relationships
- Good try on using modal to display food item detail
Some suggestions for ya:
- Consider seeding food items :)
- On food_items/1/orders/new page, consider displaying information about the food item. You can create a food_item partial so that it can be re-used on the menu page and here.
- In HomeController#menu, you can extract the order logic into FoodItem model. That way you can easily test in a rails console and keep your controller logic simple.
- In OrdersController#create, instead of assign attribute one by one, you can try this to see if it work and shorten your code:
@object.attributes = order_params
Good work when focus on making pretty UI. Hope this gives you some ideas to improve the code base. Try to work more on the optional stories next time, there are a lot of things to learn from. If you have any questions above the points above, don't hesitate to ask!
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.