I have two classes : User, Patent and Help (belongs_to :user and belongs_to :patent) When I click to a link I must create an "Help" that refer to the patent and also to the users. One user is the helper and the other one is the caller.
patents_controller:
def create
@patent = Patent.find(params[:patent_id])
@patent.helps.create(:caller_id => @current_user.id, :user => @patent.user)
respond_to do |format|
format.html { redirect_to @patent }
format.js
end
end
The problem is I created a "caller_id" to store the second user.id that is not liked to the user model.
<%= help.user.name %>
give me the right name of the first
how can I show the name of the caller from his caller_id
or make some connection ?