This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GEM | |
remote: https://rubygems.org/ | |
specs: | |
actioncable (5.1.4) | |
actionpack (= 5.1.4) | |
nio4r (~> 2.0) | |
websocket-driver (~> 0.6.1) | |
actionmailer (5.1.4) | |
actionpack (= 5.1.4) | |
actionview (= 5.1.4) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source 'https://rubygems.org' | |
git_source(:github) do |repo_name| | |
repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/") | |
"https://github.com/#{repo_name}.git" | |
end | |
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' | |
gem 'rails', '~> 5.1.4' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require File.expand_path('../boot', __FILE__) | |
require 'csv' | |
require 'rails/all' | |
# require 'wicked_pdf' | |
# Require the gems listed in Gemfile, including any gems | |
# you've limited to :test, :development, or :production. | |
Bundler.require(*Rails.groups) | |
module Workorder | |
class Application < Rails::Application |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##Routes File | |
resources :customers, shallow: :true do | |
resources :campers do | |
resources :appointments do | |
resources :orders do | |
member do | |
patch :complete | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CampersController < ApplicationController | |
before_action :set_camper, only: [:show, :edit, :update, :destroy] | |
# before_action :set_customer, only: [:index, :new, :edit, :create, :update] | |
load_and_authorize_resource | |
# GET /campers | |
# GET /campers.json | |
def index | |
@campers = @customer.campers | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AppointmentsController < ApplicationController | |
before_action :set_appointment, only: [:show, :edit, :update, :destroy] | |
# GET /appointments | |
# GET /appointments.json | |
def index | |
@appointments = @camper.appointments | |
end | |
# GET /appointments/1 | |
# GET /appointments/1.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wall GET /wall(.:format) wall#index | |
shop GET /shop(.:format) wall#shop | |
campers_list GET /campers/list(.:format) campers#list | |
new_admin_session GET /admins/sign_in(.:format) admins/sessions#new | |
admin_session POST /admins/sign_in(.:format) admins/sessions#create | |
destroy_admin_session DELETE /admins/sign_out(.:format) admins/sessions#destroy | |
admin_password POST /admins/password(.:format) devise/passwords#create | |
new_admin_password GET /admins/password/new(.:format) devise/passwords#new | |
edit_admin_password GET /admins/password/edit(.:format) devise/passwords#edit | |
PATCH /admins/password(.:format) devise/passwords#update |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Customer Search that works | |
### Search Field in Customer Index Page with Table | |
``` | |
<%= search_form_for @search do |f| %> | |
<th colspan="2"><%= f.text_field :lastName_cont, class: 'customer-search', placeholder: 'Search By Last Name' %></th> | |
<th><%= f.submit "Search", class: 'btn btn-info btn-block' %></th> | |
<% end %> | |
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// application_helper.rb | |
def us_states | |
[ | |
['Alabama', 'AL'], | |
['Alaska', 'AK'], | |
['Arizona', 'AZ'], | |
['Arkansas', 'AR'], | |
['California', 'CA'], | |
['Colorado', 'CO'], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sales-Macbook-Air:Workorder serveradmin$ rake routes | |
Prefix Verb URI Pattern Controller#Action | |
new_admin_session GET /admins/sign_in(.:format) devise/sessions#new | |
admin_session POST /admins/sign_in(.:format) devise/sessions#create | |
destroy_admin_session DELETE /admins/sign_out(.:format) devise/sessions#destroy | |
admin_password POST /admins/password(.:format) devise/passwords#create | |
new_admin_password GET /admins/password/new(.:format) devise/passwords#new | |
edit_admin_password GET /admins/password/edit(.:format) devise/passwords#edit | |
PATCH /admins/password(.:format) devise/passwords#update | |