I have a post & request.
I need when user on post page click on button “Add request” and filled out the form with his name and phone number, with this two params I had a post title or post ID on requests#index page
How I can do this?
http://rostbiz.herokuapp.com/posts/1 when user on this page click on blue button. He refer on form http://rostbiz.herokuapp.com/requests/new where he fill his name & phone nubmer. I need to know, that on page
http://rostbiz.herokuapp.com/requests/1 I see this information:
1 name
2 phone number
3 post name (from http://rostbiz.herokuapp.com/posts/1)
I need hidden_field :post_id, but how I can recieve this ID on page http://rostbiz.herokuapp.com/requests/new
May be I can with request.referer get id for f.hidden_field :post_id, post_id
and validate post_id? But I don’t know how do this:)
Send post_id as a parameter
Find post in requests_controller’s new action.
Use it like below in new request form