Is this, the best way to sanitize 'join' params inside a Controller in Rails 4?
assume:
user_name = params[:user_name]
.
# That's the only way that I can figure this out:
@result = Agenda.joins("LEFT JOIN meetings AS me ON meetings.agenda_id = agendas.id WHERE me.name = #{Agenda.sanitize(user_name})"
I have tried this but don't works because 'joins' expect tables after each ',':
@result = Agenda.joins("LEFT JOIN meetings AS me ON meetings.agenda_id = agendas.id WHERE me.name = ?", user_name)
Note: This is just a bit of the code to explain the problem, in the full code I really have to use the LEFT JOIN.