- Make restaurant controller methods for edit, update, destroy check the current user before executing.
@restaurant.owner == current_user
I think we already talked about this, but I thought it would help to write it down.
One way we could filter restaurants by area is by creating a table called locations with this structure:
create_table :landmarks do |t|
t.string :name
end
create_table :distances do |t|
t.integer :landmark_id
t.integer :restuarant_id
t.integer :radius
end
For a given landmark and restaurant, the distances table has an entry with the distance between them, rounded to the nearest km.
This will make it easier for people to select a location from a list and filter by the maximum distance.
In order from top to bottom:
- Sign in / sign up
- Make a new reservation form
- restaurants
- number of people
- time
- List of promotions/specials
- List of restaurants (will be filtered later)
After the new reservation form is submitted, if the user is not logged in, they are asked to sign up so the contact information can be added.
Will be done later
Details about the restaurant. If the user is logged in, and they are the owner, a list of reservations. Ability to approve or reject them?
Fields
- user_id
- restaurant_id
- date/time
- number of people Associations:
- belongs_to :user
- belongs_to :restaurant
- name
- address
- phone
- picture link
- description
- category_id
- capacity Associations:
- has_many :users, through: :reservations
- has_many :reservations
- name
- password_digest
- postal_code
- name Associations