Problem with restful_authentication

You'll need to make a migration to add the extra columns to your users table. restful_authentication generates a user model/views/controller. So you can edit those to accept your extra fields.

SH

Starr Horne wrote:

Are you sure you're passing the extra fields to the model?

Have you tried opening a console and manually creating a user model? That would tell you if the problem's in your model or in your controller/view

SH

--
Starr Horne
Check out my Helpdesk RailsKit: http://railskits.com/helpdesk/

Thanks again
Yes , I am sure, that I am passing the extra fields to the model.

Hmm, well it should work then :slight_smile: It might be useful for you to post some code.

SH

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 .

What is the error that you get? Does it say you are not allowed to
mass assign this (country_id) variable?

Have a look in your user model where you have the attr_accessible you
are going to have to add :country_id there.

Freddy Andersen wrote:

What is the error that you get? Does it say you are not allowed to
mass assign this (country_id) variable?

Have a look in your user model where you have the attr_accessible you
are going to have to add :country_id there.

Thank you so much for the immediate replay and solved my issue