in controller I wrote logic for submit this form so that,
all the title & body gets added into database.
But, the foreign key is not being added.
How am i suppose to do?
Well in an ideal world you’ve have something containing the user that
is creating the post (eg current_user) and you would have created your
associations between these two classes. You could then do
current_user.posts.create :title => …
in controller I wrote logic for submit this form so that,
all the title & body gets added into database.
But, the foreign key is not being added.
How am i suppose to do?
Well in an ideal world you’ve have something containing the user that
is creating the post (eg current_user) and you would have created your
associations between these two classes. You could then do
current_user.posts.create :title => …
Fred
I think I need to use session for that.
I am very new to Rails and web technology.
can anybody refer me a good documentation on session in rails?
and how can i avail it?
I think I need to use session for that.
I am very new to Rails and web technology.
can anybody refer me a good documentation on session in rails?
and how can i avail it?