The main obstacle to extract this partial was probably the paths for the flag and unflag actions. Now that we use Rails 5.1 `resolve` method to handle nested resources, we can use `polymorphic_path`. Also note the code is a bit ugly because comments render a divider. We should probably use a CSS border instead. Co-Authored-By: taitus <sebastia.roig@gmail.com>
2 lines
127 B
Plaintext
2 lines
127 B
Plaintext
App.Flaggable.update("<%= dom_id(@comment) %>", "<%= j render("shared/flag_actions", flaggable: @comment, divider: true) %>");
|