I did a bunch of gutting to my default controllers and now I can't get my user_id to populate on create.
I was curious how that gets populated. If you're interested, take a look at my routes, and model assocations, and then at then end I'll show you the resulting params..The end result is no user_id
being added.
routes
resources :users do
resources :posts do
collection do
get :view
end
end
end
models
#Post.rb
belongs_to :user, :touch => true
#User.rb
has_many :posts
I navigate to this url..
http://localhost:3001/users/1/posts/new
and place my post, and the params
return this :
{"commit"=>"save", "post"=>{"name"=>"hell hath no furry", "category"=>"vegan", "url"=>"www.reddit.com", "text"=>"", "is_link"=>"1"}, "authenticity_token"=>"aYnSLgJ9E6MaM6iSkRrCyyiMZj06oLdybTMkNqss8FA=", "utf8"=>"✓", "action"=>"create", "controller"=>"posts"}
This was working before, not sure why its not associating them anymore.
Any ideas?