add survey

This commit is contained in:
Yan
2017-11-06 18:23:38 +06:30
parent 7e19dbc1b6
commit d5efe1402f
10 changed files with 57 additions and 1 deletions

View 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/

View File

@@ -0,0 +1,3 @@
// Place all the styles related to the Origami/Surveys controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/

View File

@@ -0,0 +1,2 @@
class Origami::SurveysController < ApplicationController
end

View File

@@ -0,0 +1,2 @@
module Origami::SurveysHelper
end

2
app/models/survey.rb Normal file
View File

@@ -0,0 +1,2 @@
class Survey < ApplicationRecord
end

View File

@@ -415,4 +415,3 @@
});
});
</script> -->
>>>>>>> 01c4eeca81e1eac7bf7fe5854142a9663e104249

View File

@@ -0,0 +1,20 @@
class CreateSurveys < ActiveRecord::Migration[5.1]
def change
create_table :surveys do |t|
t.string :dining_name
t.string :receipt_no
t.integer :shift_id
t.string :created_by
t.integer :child
t.integer :adult
t.integer :male
t.integer :female
t.json :foreigner
t.integer :local
t.integer :total_customer
t.decimal :total_amount
t.timestamps
end
end
end

View File

@@ -0,0 +1,5 @@
require 'rails_helper'
RSpec.describe Origami::SurveysController, type: :controller do
end

View File

@@ -0,0 +1,15 @@
require 'rails_helper'
# Specs in this file have access to a helper object that includes
# the Origami::SurveysHelper. For example:
#
# describe Origami::SurveysHelper do
# describe "string concat" do
# it "concats two strings with spaces" do
# expect(helper.concat_strings("this","that")).to eq("this that")
# end
# end
# end
RSpec.describe Origami::SurveysHelper, type: :helper do
pending "add some examples to (or delete) #{__FILE__}"
end

View File

@@ -0,0 +1,5 @@
require 'rails_helper'
RSpec.describe Survey, type: :model do
pending "add some examples to (or delete) #{__FILE__}"
end