Adding postal code to users
This commit is contained in:
@@ -9,7 +9,7 @@ class User < ActiveRecord::Base
|
||||
:recoverable, :rememberable, :trackable, :validatable
|
||||
|
||||
# Setup accessible (or protected) attributes for your model
|
||||
attr_accessible :email, :password, :password_confirmation, :remember_me, :name, :admin, :instructor, :member, :emergency_name, :emergency_phone, :current_skills, :desired_skills, :waiver, :emergency_email, :phone, :payment_method, :orientation, :member_level, :certifications, :hidden, :marketing_source, :payee, :accountant, :exit_reason, :twitter_url, :facebook_url, :github_url, :website_url, :email_visible, :phone_visible #TODO: make admin/instructor/member/etc not accessible
|
||||
attr_accessible :email, :password, :password_confirmation, :remember_me, :name, :admin, :instructor, :member, :emergency_name, :emergency_phone, :current_skills, :desired_skills, :waiver, :emergency_email, :phone, :payment_method, :orientation, :member_level, :certifications, :hidden, :marketing_source, :payee, :accountant, :exit_reason, :twitter_url, :facebook_url, :github_url, :website_url, :email_visible, :phone_visible, :postal_code #TODO: make admin/instructor/member/etc not accessible
|
||||
|
||||
has_many :cards
|
||||
has_many :user_certifications
|
||||
@@ -19,6 +19,8 @@ class User < ActiveRecord::Base
|
||||
|
||||
validates_format_of [:twitter_url, :facebook_url, :github_url, :website_url], :with => URI::regexp(%w(http https)), :allow_blank => true
|
||||
|
||||
validates_presence_of :postal_code
|
||||
|
||||
after_create :send_new_user_email
|
||||
|
||||
def absorb_user(user_to_absorb)
|
||||
|
||||
@@ -35,6 +35,11 @@ Thanks again, and happy hacking!</p>
|
||||
<%= f.label :phone_visible, "Show Phone to All Members?" %>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<%= f.label :postal_code, "Residential Postal Code" %><br />
|
||||
<%= f.text_field :postal_code %> (we'd like to know where you're commuting from!)
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<%= f.label :twitter_url %>
|
||||
<%= f.text_field :twitter_url, :placeholder => "https://twitter.com/heatsynclabs" %><br/>
|
||||
@@ -71,13 +76,13 @@ Thanks again, and happy hacking!</p>
|
||||
<%= f.text_area :marketing_source %>
|
||||
</div>
|
||||
|
||||
<div><%= f.label :password %><% if params[:action]!='new' %> <em>(Only if you want to change your password)</em><% end %><br />
|
||||
<div><%= f.label :password %><% unless ['new','create'].include?(params[:action]) %> <em>(Only if you want to change your password)</em><% end %><br />
|
||||
<%= f.password_field :password %></div>
|
||||
|
||||
<div><%= f.label :password_confirmation %><br />
|
||||
<%= f.password_field :password_confirmation %></div>
|
||||
|
||||
<% if params[:action]!='new' %>
|
||||
<% unless ['new','create'].include?(params[:action]) %>
|
||||
<div><%= f.label :current_password, "Type Your Current Password" %> <em>(For your account's security)</em><br />
|
||||
<%= f.password_field :current_password %></div>
|
||||
<% end %>
|
||||
|
||||
@@ -46,6 +46,10 @@
|
||||
<%= f.check_box :phone_visible %>
|
||||
<%= f.label :phone_visible, "Show Phone to All Members?" %>
|
||||
</div>
|
||||
<div class="field">
|
||||
<%= f.label :postal_code, "Residential Postal Code" %><br />
|
||||
<%= f.text_field :postal_code %> (we'd like to know where you're commuting from!)
|
||||
</div>
|
||||
<div class="field">
|
||||
<%= f.label :twitter_url %>
|
||||
<%= f.text_field :twitter_url, :placeholder => "https://twitter.com/heatsynclabs" %><br/>
|
||||
|
||||
Reference in New Issue
Block a user