app/controllers/rdf_controller.rb in iqvoc_skosxl-2.9.1 vs app/controllers/rdf_controller.rb in iqvoc_skosxl-2.11.3
- old
+ new
@@ -1,22 +1,23 @@
require_dependency Iqvoc.root.join('app/controllers/rdf_controller').to_s
-class RdfController
- def show_with_labels
+# TODO: move out of /controllers
+module RdfControllerLabelExtension
+ def show
scope = params[:published] == '0' ? Iqvoc::XLLabel.base_class.unpublished : Iqvoc::XLLabel.base_class.published
if @label = scope.by_origin(params[:id]).with_associations.last
respond_to do |format|
format.html {
redirect_to label_url(id: @label.origin, published: params[:published])
}
- format.any {
+ format.any(:rdf, :ttl, :nt) {
authorize! :read, @label
- render 'show_label'
+ render 'labels/show'
}
end
else
- show_without_labels
+ super
end
end
-
- alias_method_chain(:show, :labels)
end
+
+RdfController.prepend(RdfControllerLabelExtension)
\ No newline at end of file