Merge branch 'master' into 3354-render-textile
[arvados.git] / apps / workbench / app / controllers / application_controller.rb
index 5c99c15abc62544f79c4bca6f148da051f8e59a8..d2f4ed44b240990b5c611c34d0103a478924c7f4 100644 (file)
@@ -202,7 +202,13 @@ class ApplicationController < ActionController::Base
       return render_not_found("object not found")
     end
     respond_to do |f|
-      f.json { render json: @object.attributes.merge(href: url_for(action: :show, id: @object)) }
+      f.json do
+        extra_attrs = { href: url_for(action: :show, id: @object) }
+        @object.textile_attributes.each do |textile_attr|
+          extra_attrs.merge!({ "#{textile_attr}Textile" => view_context.render_content_from_database(@object.attributes[textile_attr]) })
+        end
+        render json: @object.attributes.merge(extra_attrs)
+      end
       f.html {
         if params['tab_pane']
           render_pane params['tab_pane']