From 179ba8f16dcf3d7f50707ff65b935092280a33a6 Mon Sep 17 00:00:00 2001 From: Phil Hodgson Date: Sun, 24 Aug 2014 13:07:34 -0400 Subject: [PATCH] 3354: Rename render_content_from_database helper to render_markup, as a more directly descriptive method name. --- apps/workbench/app/controllers/application_controller.rb | 2 +- apps/workbench/app/helpers/application_helper.rb | 4 ++-- apps/workbench/app/views/application/show.html.erb | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/apps/workbench/app/controllers/application_controller.rb b/apps/workbench/app/controllers/application_controller.rb index d2f4ed44b2..aaf1ae0cb1 100644 --- a/apps/workbench/app/controllers/application_controller.rb +++ b/apps/workbench/app/controllers/application_controller.rb @@ -205,7 +205,7 @@ class ApplicationController < ActionController::Base 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]) }) + extra_attrs.merge!({ "#{textile_attr}Textile" => view_context.render_markup(@object.attributes[textile_attr]) }) end render json: @object.attributes.merge(extra_attrs) end diff --git a/apps/workbench/app/helpers/application_helper.rb b/apps/workbench/app/helpers/application_helper.rb index a219cd5cc3..de7fd17c09 100644 --- a/apps/workbench/app/helpers/application_helper.rb +++ b/apps/workbench/app/helpers/application_helper.rb @@ -11,7 +11,7 @@ module ApplicationHelper Rails.configuration.arvados_v1_base.gsub /https?:\/\/|\/arvados\/v1/,'' end - def render_content_from_database(markup) + def render_markup(markup) raw RedCloth.new(markup.to_s).to_html(:refs_arvados, :textile) if markup end @@ -455,6 +455,6 @@ private end def render_textile_if_textile( object, attr, attrvalue ) - is_textile?( object, attr ) ? render_content_from_database(attrvalue) : attrvalue + is_textile?( object, attr ) ? render_markup(attrvalue) : attrvalue end end diff --git a/apps/workbench/app/views/application/show.html.erb b/apps/workbench/app/views/application/show.html.erb index 105e1c356d..21d6d15dd2 100644 --- a/apps/workbench/app/views/application/show.html.erb +++ b/apps/workbench/app/views/application/show.html.erb @@ -10,16 +10,16 @@ <% if @object.properties[:page_content] %> <% content_for :page_content do %>

- <%= render_content_from_database(@object.properties[:page_title] || @object.uuid) %> + <%= render_markup(@object.properties[:page_title] || @object.uuid) %>

- + <% if @object.properties[:page_subtitle] %>

- <%= render_content_from_database @object.properties[:page_subtitle] %> + <%= render_markup @object.properties[:page_subtitle] %>

<% end %> - <%= render_content_from_database @object.properties[:page_content] %> + <%= render_markup @object.properties[:page_content] %> <% end %> <% end %> <% end %> -- 2.30.2