Forum: Ruby on Rails Edit message property in messages list

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Denis K. (Guest)
on 2009-05-15 12:45
(Received via mailing list)
I'm writing a web-based organizer of email messages.

Let's say I have boolean “Marked as Important” property for each
message. I display it with an icon in the list of messages (for each
message in list).
And I want to give user ability to change this property by clicking
this icon right to particular message in the messages list, just like
the “Starred” icon in Gmail.

I'm a newbie in RoR, so my suggestion is to add some action in the
messages controller (“mark_as_important”, for example) and try to make
it work almost like Update action: it should inverse boolean “Marked
as Important” property of message, update it and redirect back to
messages list (I don't want to use AJAX for the first time, may be
I'll add it later).

How can I do this? Do I really need to add specific action in the
controller or I can use Update action (in this case, what code should
I place there?)?
This topic is locked and can not be replied to.