Hi,
I’m writting a rails app to manage mp3 files online.
I want to updade distinct model objects in different situations.
-
When an user go to save a new record, I code the controller to
save all fields to DB, without restrictions. (this was done). -
When an user go to save an existing record, two cases can happen:
a) the record is of the proper user: so, I want to code the
controller to show informations to that user, like “the <file.mp3> has
been saved by you. Do you want to edit them?” and display the related
form. But, I have another solution: only display the informations and
highlight the mp3 entry. What the best solution, for this case? And,
if possible, how can I code this?
b) the record is of another user: so, I want to code the controller
to show a form with unique input fields readonly, like “title” and
permit other fields to be salved by the user. But, this time, the
field ‘description’ will be saved as a comment for the existing entry,
in a table comments for the model Comment. How can I code this?
When I have a Comment model and need know ‘who’ comments ‘what’ file,
but the Comment belogs_to ‘MP3 model’, can I put a user_id field in
the comments table? Or would more currect put it in another place? If
so, where?
Thanks for the support,
Ranieri T.