This could be simplified to:

<code>asset.selected = asset.id == params[:logo_id].to_i</code>