Skip to content

Instantly share code, notes, and snippets.

@chanced
Created September 28, 2011 02:24
Show Gist options
  • Save chanced/1246837 to your computer and use it in GitHub Desktop.
Save chanced/1246837 to your computer and use it in GitHub Desktop.
form(method = "post", action = "/agencies")
input(type = "hidden", name = "csrf", value = "csrf")
label Name
input( type = "text", name = "agency[name]", value= agency.name? agency.name = "")
label Type
select( name = "agency[type]")
option(value= '', selected = (agency.type == '')) Select Agency Type
option(value= 'medical', selected= (agency.type =='medical')) Medical Service
option(value= 'disasterService', selected= (agency.type=='disasterService')) Disaster Service
option(value= 'local-law', selected= (agency.type=='local-law')) Law Enforcement, Local
option(value= 'state-law', selected= (agency.type=='state-law')) Law Enforcement, State
option(value= 'federal-law', selected= (agency.type=='federal-law')) Law Enforcement, Federal
ul#addresses
- each address in agency.addresses
- var inputName = 'agency[addresses][' + address._id + ']';
li
ul
li
label(for= inputName + '[name]')
span Name
input(type= "text", name= inputName('name'), value= address.name)
li
label(for= inputName+'[street1]')
span Address
input(type= "text", name= inputName('street1'), value= address.street1)
li
label(for= inputName+'[street2]')
span Apt/Suite
input(type= "text", name= inputName + "[street2]", value= address.street2)
li
label(for= inputName+'[city]')
span City
input(type= "text", name= inputName + "[city]", value= address.city)
li
label(for= inputName+'[state]')
span State
select( name = inputName+ "[state]")
option(value= '', selected= agency.type == '')
option(value= 'ca', selected= agency.type == 'ca') California
option(value= 'sc', selected= agency.type == 'sc') South Carolina
li
label(for = inputName+'[zip]')
span Zip
input(type= "text", name= inputName + "[zip]", value= address.zip)
input(type= "submit", value = "Submit")
a(href='/agencies', title="cancel") Cancel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment