Hi,
I have view page which takes all the information like contact's emails ,
phones no's etc and saves different tables. I want to save more than one
email id's for a particular contact.
view page is something like this..
.
.
Email 1 :
<%= select 'email', 'email_type', %w(Business Personal), :include_blank
=> false %>
<%= text_field 'email','email',:size=>"35",:maxlength=>"80" %>
<%= radio_button 'email', 'isprimary', '1' %>Primary
Email 2 :
<%= select 'email', 'email_type', %w(Business Personal), :include_blank
=> false %>
<%= text_field 'email','email',:size=>"35",:maxlength=>"80" %>
<%= radio_button 'email', 'isprimary', '1' %>Primary
.
.
Controller is :
def create
@contact = Contact.new(params[:contact])
@contact.emails << Email.new(params[:email])
@contact.phones << Phone.new(params[:phone])
@contact.addresses << Address.new(params[:address])
puts "hellooooooo bharati"
params.inspect
if @contact.save
flash[:notice] = "Contact was successfully created."
redirect_to :action => 'list'
else
render :action => 'new'
flash[:notice] = "Contact was not created."
end
end
Can any one help me how to send more than one email ids to controller..
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---