How can I use edit_in_place in the show of a different model in Rails?
Posted
by Angela
on Stack Overflow
See other posts from Stack Overflow
or by Angela
Published on 2010-05-09T06:29:28Z
Indexed on
2010/05/09
6:38 UTC
Read the original article
Hit count: 164
inline-editing
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).
© Stack Overflow or respective owner