The Id of the current user from the controller (devise)?
Create a record of gain, want to gain.user_id was equal to the current user. Provided that installed Devise
how to do it? helper "current_user" in the controller doesn't work(
@gain = @task.gains.create(params[:gain])
asked October 8th 19 at 01:39
params_gains = params[:gain].merge(:user => current_user)
@gain = @task.gains.create(params_gains)
Find more questions by tags Ruby on Rails