Currently in my query model I have:
belongs_to :requestor, :class_name => 'User'
So the interrogator is current_user.
The problem is that he current_userclicks the Create button to submit the form for the request, all attributes are updated in the database on the form.
But since it is requestor_idnot a fill value in the form, which returns null in the database when creating a new query record.
I want an integer (which corresponds to the first key of the Users table) updated in a column requestor_idin the query table when the user clicks the create button.
So I thought that maybe adding requestor_idas a character in the parameters for the create action would solve the following:
def create_common
@a = Request.new
b = @a.requestor_id
@resource = yield params[:contact + "#{b}".to_sym]
self.resource = @resource
But instead, it returns the following error:
.