Thanks for your valuable help.
My view code is
<% form_for @user ,:html => { :multipart => true } do |f| -%>
<table>
<tr>
<td>*</td>
<td>Username</td>
<td><%= f.text_field :login%></td>
</tr>
<tr>
<td>*</td>
<td>First Name</td>
<td><%= f.text_field :name%> </td>
</tr>
<tr>
<td>*</td>
<td>E mail</td>
<td><%= f.text_field :email%></td>
</tr>
<tr>
<td>*</td>
<td>Password</td>
<td><%= f.password_field :password %></td>
</tr>
<tr>
<td>*</td>
<td>Password</td>
<td><%= f.password_field :password_confirmation %></td>
</tr>
<tr>
<td>*</td>
<td>Country</td>
<td><%=
f.select(:country_id,Country.find(:all).collect{|c|[c.name,c.id]
},:prompt=>'Select Country')%></td>
</tr> ........ <% end %>
and in my controller users_contrller in the new @user = User.new and in
create actions I just wrote @user.save. The error coming in country_id
cant' be null. since I had given the database constraint that null value
is not allowed. while i am looking the insert statement in place of
country_id value is null. but when I tried to print the
params[:user][:country_id] the value is getting. Pls help. since I had
spend more time and still vein .
--
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
-~----------~----~----~----~------~----~------~--~---