[PageOneX] [dev] question re: #61 "Thread edit: not possible to add a topic"
pablo rey
pablo at basurama.org
Tue Mar 19 13:36:47 EDT 2013
I don't know if you receive the comments for the issues.
Here's my question re: #61 "Thread edit: not possible to add a topic"
https://github.com/numeroteca/pageonex/issues/61#issuecomment-15128625
At threads_controller.rb the new codes/topic created in the edit view don't
get saved. What else should I use instead of "update_attributes"?
In the update method:
#it should iterate through the recently created
codes at thread.codes.to_enum.with_index.each do |code,index|
if params["topic_deleted_#{index}"] == '1'
code.destroy()
else #To Do: it should save the new codes created
code.update_attributes({code_text:
params["topic_name_#{index}"], color: params["topic_color_#{index}"],
code_description: params["topic_description_#{index}"]})
end
end
besides "params[:topic_count].to_i" was not working and I used
"@thread.codes.length" in the update method.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.mit.edu/pipermail/pageonexdev/attachments/20130319/3ca6dcc0/attachment.htm
More information about the Pageonexdev
mailing list