From 98e356513c2c7a231e6c8016e8ddddfd24c22114 Mon Sep 17 00:00:00 2001 From: JiangRu Date: Wed, 7 Jan 2015 10:53:01 +0800 Subject: [PATCH] fix open_link target --- app/controllers/web_resources_controller.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/controllers/web_resources_controller.rb b/app/controllers/web_resources_controller.rb index 41cc74d..4242f19 100644 --- a/app/controllers/web_resources_controller.rb +++ b/app/controllers/web_resources_controller.rb @@ -9,11 +9,18 @@ class WebResourcesController < ApplicationController "status-class" => "status-#{status['classname']}" } end + if link.link_open == "new_window" + target = "_blank" + elsif link.link_open == "local" + target = "_self" + end + { "title" => link.title, "context" => link.context, "statuses" => statuses, - "link_to_show" => link.url + "link_to_show" => link.url, + "target" => target } end {