I'm having problems when I'm trying to put a condition in params in my controller. This code is inside my controller:
if params[:example] == 1
@table = Model.find(:all,:conditions=>['column_table= ?',params[:example] ] )
else
@table = Model.find(:all,:conditions=>['column_table2= ?',params[:example] ] )
end
Is this code correct? How can I put a conditional in params controller?