Skip to content

Instantly share code, notes, and snippets.

@staycreativedesign
Created July 31, 2017 15:23
Show Gist options
  • Save staycreativedesign/9c50e38b44c611e1f55f08ca2e2afd7f to your computer and use it in GitHub Desktop.
Save staycreativedesign/9c50e38b44c611e1f55f08ca2e2afd7f to your computer and use it in GitHub Desktop.
class Job < ApplicationRecord
has_one :user
end
%h4
Enter your information
= form_for @user do |f|
= f.label :first_name
= f.text_field :first_name
= f.label :last_name
= f.text_field :last_name
%h4 login details into Bold Networking
= f.label :email
= f.text_field :email
= f.label :password
= f.password_field :password
= fields_for :job do |job|
%h4
Your Employer / Business name
= job.label :employer
= job.text_field :employer
%h4
please select a your business category
= select_tag "user[business_category]", options_from_collection_for_select(BusinessCategory.all, "id", "name"), prompt: "Please select a Business Category"
= select_tag "user[business_industry_id]", options_for_select([])
%h4
Your Employer / Business information
= job.label :adress
= job.text_field :address
= job.label :address2
= job.text_field :address2
= job.label :city
= job.text_field :city
= job.label :state
= job.select :state, options_for_select(states)
= job.label :zipcode
= job.text_field :zipcode
= submit_tag "Join Bold Networking"
class User < ActiveRecord::Base
accepts_nested_attributes_for :job
def user_params
params.require(:user).permit(:first_name, :last_name, :email, :password, :team_id, :phone_number, :birthday, :business_industry_id, :business_category_id,
job_attributes: [:employer])
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment