如何在 Rails 中显示不同模型时使用 edit_in_place ?

发布于 2024-08-31 16:01:00 字数 437 浏览 4 评论 0原文

我有一个模型活动,活动/节目会经历电子邮件循环。活动有_很多电子邮件。

<h2>Emails to Send Today</h2>

<% for email in @campaign.emails %>
    <p><strong>Email: </strong><%= link_to email.title, email_path(email) %> sent after 
       <%= distance_of_time_in_words(email.days.days) %></p>
<% end %> 

我希望能够在活动/显示页面中就地编辑主题和/或 email.days 值。

我该怎么做? (增加了复杂性,这些是可点击的链接)。

I have a model Campaign and the campaign/show goes through a loop of the Emails. Campaign has_many Emails.

<h2>Emails to Send Today</h2>

<% for email in @campaign.emails %>
    <p><strong>Email: </strong><%= link_to email.title, email_path(email) %> sent after 
       <%= distance_of_time_in_words(email.days.days) %></p>
<% end %> 

I would like to be able to edit in place the subject and/or the email.days value from the Campaign/show page.

How do I do that? (Added complexity, these are clickable links).

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

没有伤那来痛 2024-09-07 16:01:00

我需要再试一次,似乎没有得到任何回应。

I will need to try again, don't seem to be getting any responses.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文