Hi there,
I’m trying to create a plugin that surfaces a checkbox when creating a topic on the UI, and that basically saves a new attribute in the topics table. Basically I need to get the attribute saved whehter the checbox was clicked or not, and then surface the new attrbute when visiting a Topics page.
I started from the backend, adding a migration that creates a new boolean attribute to Topics, defaulted to false and next I was working on the controller. But I haven’t been able to find a way to add the new attribute in the function posts from TopicsController.
I couldnt find anything like this on the tutorials.
Thanks in advance!
after_initialize do
module ::DiscourseXPlugin
class ::TopicsController
def posts
Rails.logger.info '┌────────────┐'
Rails.logger.info '│ Here we go │'
Rails.logger.info '└────────────┘'
end
end
end
end