add zone test-rspec
This commit is contained in:
3
app/assets/javascripts/api/restaurant/zone.coffee
Normal file
3
app/assets/javascripts/api/restaurant/zone.coffee
Normal file
@@ -0,0 +1,3 @@
|
||||
# Place all the behaviors and hooks related to the matching controller here.
|
||||
# All this logic will automatically be available in application.js.
|
||||
# You can use CoffeeScript in this file: http://coffeescript.org/
|
||||
3
app/assets/stylesheets/api/restaurant/zone.scss
Normal file
3
app/assets/stylesheets/api/restaurant/zone.scss
Normal file
@@ -0,0 +1,3 @@
|
||||
// Place all the styles related to the api/restaurant/zone controller here.
|
||||
// They will automatically be included in application.css.
|
||||
// You can use Sass (SCSS) here: http://sass-lang.com/
|
||||
4
app/controllers/api/restaurant/zone_controller.rb
Normal file
4
app/controllers/api/restaurant/zone_controller.rb
Normal file
@@ -0,0 +1,4 @@
|
||||
class Api::Restaurant::ZoneController < ApplicationController
|
||||
def index
|
||||
end
|
||||
end
|
||||
2
app/helpers/api/restaurant/zone_helper.rb
Normal file
2
app/helpers/api/restaurant/zone_helper.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
module Api::Restaurant::ZoneHelper
|
||||
end
|
||||
@@ -1,3 +1,6 @@
|
||||
class SeatTable < ApplicationRecord
|
||||
belongs_to :zone
|
||||
|
||||
# validations
|
||||
validates_presence_of :name,:order_by, :created_by
|
||||
end
|
||||
|
||||
@@ -1,2 +1,7 @@
|
||||
class Zone < ApplicationRecord
|
||||
# model association
|
||||
has_many :seat_tables, dependent: :destroy
|
||||
|
||||
# validations
|
||||
validates_presence_of :name, :created_by
|
||||
end
|
||||
|
||||
2
app/views/api/restaurant/zone/index.html.erb
Normal file
2
app/views/api/restaurant/zone/index.html.erb
Normal file
@@ -0,0 +1,2 @@
|
||||
<h1>Api::Restaurant::Zone#index</h1>
|
||||
<p>Find me in app/views/api/restaurant/zone/index.html.erb</p>
|
||||
Reference in New Issue
Block a user