Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
您如何获得 rails 中新创建的行的 id?
例如,
Session.create(:user_id => user_id, :email => email )
我希望有更多关于 Rails 的文档......哦,好吧,为了未来
session = Session.create(:user_id => user_id, :email => email ) puts session.id
我是 Rails、jquery 等的新手。我创建了一个新项目,一切正常。现在我想每隔几秒刷新一个 HTML 表。
我在视图中的表格如下所示:
<table> <% @new.each do |s| %> <tr> <td><%= s.name %></td> <