Created
December 6, 2012 22:05
-
-
Save coderforhire/4228933 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
<%= form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f| %> | |
<%= devise_error_messages! %> | |
<%= f.text_field :first_name, :class => "xlarge", :placeholder => "First Name" %> | |
<%= f.text_field :last_name, :class => "xlarge", :placeholder => "Last Name" %> | |
</br> | |
<%= f.email_field :email, :class => "xlarge", :placeholder => "Email*" %> | |
<%= f.text_field :phone_number, :class => "xlarge", :placeholder => "Phone Number*" %> | |
</br> | |
<%= f.text_field :street_address, :class => "xlarge", :placeholder => "Street" %> | |
<%= f.text_field :city, :class => "xlarge", :placeholder => "City" %> | |
</br> | |
<%= f.text_field :state, :class => "xlarge", :placeholder => "State" %> | |
<%= f.text_field :zip_code, :class => "xlarge", :placeholder => "Zip Code" %> | |
</br> | |
<%= f.password_field :password, :class => "xlarge", :placeholder => "Password*" %> | |
<%= f.password_field :password_confirmation, :class => "xlarge", :placeholder => "Password, again please.*" %> | |
</br> | |
<%= select, :job, :num_of_shirts, ["0-5"] %> | |
</br> | |
<%= f.submit "GET QUOTE!", :class => "btn btn-large btn-success" %> | |
<% end %> | |
This file contains hidden or 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 User < ActiveRecord::Base | |
# Include default devise modules. Others available are: | |
# :token_authenticatable, :confirmable, | |
# :lockable, :timeoutable and :omniauthable | |
before_create :create_job | |
has_many :invoices | |
has_many :jobs | |
devise :database_authenticatable, :registerable, | |
:recoverable, :rememberable, :trackable, :validatable | |
# Setup accessible (or protected) attributes for your model | |
# | |
attr_accessible :email, :password, :password_confirmation, :remember_me, :first_name, :last_name, :num_of_shirts, :street_address, :city, :state, :zip_code, :phone_number | |
def create_job(num_of_shirts) | |
job = Job.create | |
self.user_id = user_id | |
!save | |
end | |
end | |
~ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment