in a controller I have a create action
def create
params[:note]
@note = current_user.notes.new(params[:note])
if @note.save
respond_with @note, status: :created
else
respond_with @note.errors, status: :unprocessable_entity
end
end
I want to pass to the model another param called current_user, how to do that and how to retrive the passed param in a model method?
But perhaps this is not the best way how you do it, look at this: Adding variable to params in rails
If you want access to current_user in model, see: Rails 3 devise, current_user is not accessible in a Model ?