On 6 December 2010 17:05, John Sayeau <[email protected]> wrote:
> Maybe Because I'm running rails 2.3.5 and the book uses something lower
> I have something different fixtures. I swapped in the ones from the
> book's source and now it works. I hope I get an explanation as to
> fixtures use as I go on in the book...thanks.
>
> This is what was in my users.yml file:
>
> # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
>
> one:
>  title: MyString
>  description: MyText
>  image_url: MyString
>
> two:
>  title: MyString
>  description: MyText
>  image_url: MyString

I would have expected the fixtures to have been generated when you
generated the model.  Are you sure you put the right fields in when
you generated the user model?  Check back in your source control
system and see when you created it.  The fixtures should match the
migration created at the same time.  If you are not using a source
control system then install git and start using it.  The few hours
learning curve (if you do not already use it) will be recovered many
times over.

Colin

>
> I looked at the source code from the book and for users.yml, it is this:
>
>
> <% SALT = "NaCl" unless defined?(SALT) %>
>
> dave:
>  name: dave
>  salt: <%= SALT %>
>  hashed_password: <%= User.encrypted_password('secret', SALT) %>
>
> --
> 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.
>
>

-- 
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.

Reply via email to