mirror of
https://github.com/fspc/bike-database.git
synced 2026-09-16 08:31:39 -04:00
Louis | Adds agencies
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
- disabled ||= false
|
||||
.form-horizontal
|
||||
.form-group
|
||||
= f.label "Name of Agency:", class: "col-sm-2 control-label"
|
||||
.col-sm-10
|
||||
= f.text_field :agency_name, class: "form-control", disabled: disabled
|
||||
|
||||
.form-group
|
||||
= f.label "Contact Name:", class: "col-sm-2 control-label"
|
||||
.col-sm-10
|
||||
= f.text_field :contact_name, class: "form-control", disabled: disabled
|
||||
|
||||
.form-group
|
||||
= f.label "Street Address:", class: "col-sm-2 control-label"
|
||||
.col-sm-10
|
||||
= f.text_field :street_address, class: "form-control", disabled: disabled
|
||||
|
||||
.form-group
|
||||
= f.label "City:", class: "col-sm-2 control-label"
|
||||
.col-sm-10
|
||||
= f.text_field :city, class: "form-control", disabled: disabled
|
||||
|
||||
.form-group
|
||||
= f.label "State:", class: "col-sm-2 control-label"
|
||||
.col-sm-10
|
||||
= f.text_field :state, class: "form-control", disabled: disabled
|
||||
|
||||
.form-group
|
||||
= f.label "Postal Code:", class: "col-sm-2 control-label"
|
||||
.col-sm-10
|
||||
= f.text_field :postal_code, class: "form-control", disabled: disabled
|
||||
|
||||
.form-group
|
||||
= f.label "Phone Number", class: "col-sm-2 control-label"
|
||||
.col-sm-10
|
||||
= f.text_field :phone_number, class: "form-control", disabled: disabled
|
||||
|
||||
.form-group
|
||||
= f.label "email", class: "col-sm-2 control-label"
|
||||
.col-sm-10
|
||||
= f.text_field :email, class: "form-control", disabled: disabled
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
= form_for @agency, html: {class: 'form-horizontal'} do |f|
|
||||
- if @agency.errors.any?
|
||||
#error_explanation
|
||||
%h2= pluralize(@agency.errors.count, "error") + " prohibited this agency from being saved:"
|
||||
%ul
|
||||
- @agency.errors.full_messages.each do |msg|
|
||||
%li= msg
|
||||
= render 'fields', f: f
|
||||
.row
|
||||
.actions.col-sm-offset-2
|
||||
= f.submit class: "btn btn-default"
|
||||
@@ -0,0 +1,6 @@
|
||||
.container
|
||||
%h1 Edit Agency
|
||||
= render 'form'
|
||||
= link_to 'Show', @agency
|
||||
|
|
||||
= link_to 'Back', agencies_path
|
||||
@@ -0,0 +1,20 @@
|
||||
.container
|
||||
%h1 Agencies
|
||||
|
||||
%table.table.table-striped.table-bordered.table-hover
|
||||
%thead
|
||||
%tr
|
||||
%th Agency
|
||||
%th
|
||||
%th
|
||||
%th
|
||||
%tbody
|
||||
- @agencies.each do |agency|
|
||||
%tr
|
||||
%td= agency.agency_name
|
||||
%td= link_to 'Show', agency
|
||||
%td= link_to 'Edit', edit_agency_path(agency)
|
||||
%td= link_to 'Destroy', agency, method: :delete, data: { confirm: 'Are you sure?' }
|
||||
|
||||
%br
|
||||
= link_to ' + New Agency', new_agency_path, class: "btn btn-default"
|
||||
@@ -0,0 +1,4 @@
|
||||
.container
|
||||
%h1 New Agency
|
||||
= render 'form'
|
||||
= link_to 'Back', agencies_path
|
||||
@@ -0,0 +1,7 @@
|
||||
.container
|
||||
%p#notice= notice
|
||||
= form_for(@agency) do |f|
|
||||
= render 'fields', f: f, disabled: true
|
||||
= link_to 'Edit', edit_agency_path(@agency)
|
||||
|
|
||||
= link_to 'Back', agencies_path
|
||||
Reference in New Issue
Block a user