Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/56.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 视图中的布尔值_Html_Ruby On Rails_View_Internationalization_Boolean - Fatal编程技术网

Html 视图中的布尔值

Html 视图中的布尔值,html,ruby-on-rails,view,internationalization,boolean,Html,Ruby On Rails,View,Internationalization,Boolean,我很难在视图中显示布尔值的结果 我想显示启用和禁用,但显示true或false 我在index.html.slim中的代码 th Active? td = plan.enable p strong Active ?: = @plan.enable show.html.slim中的我的代码 th Active? td = plan.enable p strong Active ?:

我很难在视图中显示布尔值的结果
我想显示启用和禁用,但显示true或false

我在index.html.slim中的代码

      th Active?  
          td = plan.enable
   p
    strong Active ?:
    = @plan.enable
show.html.slim中的我的代码

      th Active?  
          td = plan.enable
   p
    strong Active ?:
    = @plan.enable

我怎样才能解决这个问题呢?

你应该研究三元数

在你看来,你可以这样做