Ok, I've got a nested resource, set up like so:
map.resources :users, :has_one => :profile
When I create a user, I'm using this route to go the new profile page:
I'm my Profiles controller, I'm using a before_filter to determine the
@user = User.find(params[:user_id])
And in my "new" action:
@profile = @user.profile.new
In my view, I have:
form_for([@user, @profile]) do |f|
But I get an error telling me that @user.profile is nil.
The :user_id paramter is coming through fine, and @user has all the
proper data in it. So is the problem with the scoped ActiveRecord call
If I use @profile = Profile.new, I get an error telling me
"user_profiles_path" in invalid (which I guess is being generated by the
form_for). This is correct, since User should only have one Profile, not
the plural "profiles."
Anyone know what's going on?