Hey all,
Currently, in my request model I have:
belongs_to :requestor, :class_name => 'User'
So the requestor is the current_user.
Problem is when the current_user
clicks the create button to submit a form for a request, all of the attributes get updated to the database that are in the form.
But since requestor_id
is not a value to fill out in the form, that brings back a value of null in the database when the new request record is created.
What I want is an integer (which equates to the primary key of the Users table) updated in the requestor_id
column in the request table when the user clicks the create button.
So I thought that maybe adding a requestor_id
as a symbol in the params for the create action would solve that:
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:
interning empty string
Thanks for any suggestions.