如何让帖子内部链接在新的标签页打开?


(HeroCat) #1

最近写了几个帖子 ,里面有站外的链接,不希望跳到站外后 返回成本那么高,请问如何让帖子内部链接在新的标签页打开?在后台没找到这个选项,有实现过的吗?@fantasticfears


(HeroCat) #2

这个选项貌似没起作用。@fantasticfears


(中式青春) #4

有同样的问题,用户发的链接如何才能在新标签打开呢?这样一转,直接转到链接网址去了。


(HeroCat) #5

就是我发的那个选项。勾选后 以后注册的用户都会在新的标签页打开,老用户 只能通知他们在个人设置里修改。


(Erick Guan) #6

是这样。当然你还可以用代码给老用户设置这个选项。

User.all.each {|u| u.external_links_in_new_tab = true; u.save}


(HeroCat) #7

这个代码如何操作,能详细讲一下吗


(Erick Guan) #8

./launcher enter app 进入到容器中,然后 rails c,再打这行代码。


(HeroCat) #9

:/mnt/discourse# sudo ./launcher enter app
Error: Command not found: exec
Error: Command not found: -it
Usage: docker [OPTIONS] COMMAND [arg…]
-H=[unix:///var/run/docker.sock]: tcp://host:port to bind/connect to or unix://path/to/socket to use

A self-sufficient runtime for linux containers.

Commands:
attach Attach to a running container
build Build an image from a Dockerfile
commit Create a new image from a container’s changes
cp Copy files/folders from a container’s filesystem to the host path
diff Inspect changes on a container’s filesystem
events Get real time events from the server
export Stream the contents of a container as a tar archive
history Show the history of an image
images List images
import Create a new filesystem image from the contents of a tarball
info Display system-wide information
inspect Return low-level information on a container
kill Kill a running container
load Load an image from a tar archive
login Register or log in to a Docker registry server
logout Log out from a Docker registry server
logs Fetch the logs of a container
port Lookup the public-facing port that is NAT-ed to PRIVATE_PORT
pause Pause all processes within a container
ps List containers
pull Pull an image or a repository from a Docker registry server
push Push an image or a repository to a Docker registry server
restart Restart a running container
rm Remove one or more containers
rmi Remove one or more images
run Run a command in a new container
save Save an image to a tar archive
search Search for an image on the Docker Hub
start Start a stopped container
stop Stop a running container
tag Tag an image into a repository
top Lookup the running processes of a container
unpause Unpause a paused container
version Show the Docker version information
wait Block until a container stops, then print its exit code

进不去了,这是什么情况。


(Erick Guan) #10

Docker 版本是大于 1.3 的吗?

你也可以试试 ssh 的登录情况如何。(如果你原来配置过的话)


(吃草的兔子) #11

NoMethodError: undefined method external_links_in_new_tab=' for #<User:0x0000556dc108c440> from /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activemodel-5.1.4/lib/active_model/attribute_methods.rb:432:inmethod_missing’

找不到