mirror of
https://github.com/fspc/bike-database.git
synced 2025-04-04 10:03:22 -04:00
lk | renames columns on agencies table
This commit is contained in:
parent
692f12d47d
commit
7cd1b7a7a4
@ -45,13 +45,13 @@ class AgenciesController < ApplicationController
|
||||
|
||||
def agency_params
|
||||
params.require(:agency).permit(
|
||||
:agency_name,
|
||||
:name,
|
||||
:contact_name,
|
||||
:street_address,
|
||||
:city,
|
||||
:state,
|
||||
:postal_code,
|
||||
:phone_number,
|
||||
:phone,
|
||||
:email)
|
||||
end
|
||||
end
|
||||
|
@ -3,7 +3,7 @@
|
||||
.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
|
||||
= f.text_field :name, class: "form-control", disabled: disabled
|
||||
|
||||
.form-group
|
||||
= f.label "Contact Name:", class: "col-sm-2 control-label"
|
||||
@ -33,7 +33,7 @@
|
||||
.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
|
||||
= f.text_field :phone, class: "form-control", disabled: disabled
|
||||
|
||||
.form-group
|
||||
= f.label "email", class: "col-sm-2 control-label"
|
||||
|
@ -11,7 +11,7 @@
|
||||
%tbody
|
||||
- @agencies.each do |agency|
|
||||
%tr
|
||||
%td= agency.agency_name
|
||||
%td= 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?' }
|
||||
|
@ -0,0 +1,6 @@
|
||||
class ChangeAgencyPhoneNumberToAgencyPhone < ActiveRecord::Migration
|
||||
def change
|
||||
rename_column :agencies, :phone_number, :phone
|
||||
rename_column :agencies, :agency_name, :name
|
||||
end
|
||||
end
|
@ -11,19 +11,19 @@
|
||||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(version: 20160717165815) do
|
||||
ActiveRecord::Schema.define(version: 20160724130507) do
|
||||
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "plpgsql"
|
||||
|
||||
create_table "agencies", force: :cascade do |t|
|
||||
t.string "agency_name"
|
||||
t.string "name"
|
||||
t.string "contact_name"
|
||||
t.string "street_address"
|
||||
t.string "city"
|
||||
t.string "state"
|
||||
t.string "postal_code"
|
||||
t.string "phone_number"
|
||||
t.string "phone"
|
||||
t.string "email"
|
||||
end
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user