# Comandi della console Rails

**URL:** <https://meta.discourse.org/t/rails-console-commands/300682>\
**Category:** Development\
**Tags:** rails-console\
**Created:** [23 Marzo 2024, 11:40pm UTC](https://meta.discourse.org/t/rails-console-commands/300682 "2024-03-23T23:40:01Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)\
**Post date:** [24 Marzo 2024, 10:28am UTC](https://meta.discourse.org/t/rails-console-commands/300682/7 "2024-03-24T10:28:08Z")

</div>

> [@simon](#):
>
> `t1 = Topic.find(123)`

Sebbene ciò possa facilmente causare un’eccezione (che si consiglia di gestire), potresti voler utilizzare `find_by` come alternativa che restituirà `nil` anziché sollevare un’eccezione, a seconda di come desideri gestire le cose.

---

_[View the full topic](https://meta.discourse.org/t/rails-console-commands/300682)._
