I’m Trying to store the requesttpeid which is coming form the requesttypes table and I’m trying to stroe that ID in Requests table as requesttypetid.
Here’s what I’m trying,
in the controller :
@requesttypes = Requesttype.find_all
@emprequest = Emprequest.new
@emprequest.requesttypeid = params[:reqtype]
In the view (_form.rhtml)
<% @requesttypes.each do |requesttype| %>
<% end %>
The problem is that i’m unable to store this id in the table and it is displaying an error like nil.object
But this is working fine when I tried this with out using ajax.
Can you please help me to over come this problem,