Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/54.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
Ruby on rails 使用Rails和简单表单的自举标记_Ruby On Rails_Twitter Bootstrap_Markdown_Simple Form - Fatal编程技术网

Ruby on rails 使用Rails和简单表单的自举标记

Ruby on rails 使用Rails和简单表单的自举标记,ruby-on-rails,twitter-bootstrap,markdown,simple-form,Ruby On Rails,Twitter Bootstrap,Markdown,Simple Form,我正在尝试使用gem将引导标记添加到Rails应用程序中。我还尝试使用简单的表单来格式化布局。 引导标记需要一个数据提供属性,如项目github站点的html代码所示: 但是,当我尝试以简单形式执行此操作时,我得到一个错误:参数数量错误(0表示1..2) {:行=>5,:占位符=>“输入一些文本。”,:类=>“span6”,:数据提供=>“标记”}%> Ruby不接受符号中的“-”。。。您需要以字符串形式提供数据。。。其他一切看起来都很好。e、 g <%= f.input :ess

我正在尝试使用gem将引导标记添加到Rails应用程序中。我还尝试使用简单的表单来格式化布局。

引导标记需要一个数据提供属性,如项目github站点的html代码所示:


但是,当我尝试以简单形式执行此操作时,我得到一个错误:参数数量错误(0表示1..2)


{:行=>5,:占位符=>“输入一些文本。”,:类=>“span6”,:数据提供=>“标记”}%>

Ruby不接受符号中的“-”。。。您需要以字符串形式提供数据。。。其他一切看起来都很好。e、 g

<%= f.input :essay, :input_html => {:rows => 5, :placeholder => "Enter some text.", :class => "span6", "data-provide" => "markdown" }%>
{:rows=>5,:placeholder=>“输入一些文本。”,:class=>“span6”,“数据提供”=>“标记”}%>
或者,我认为您也可以选择使用Rails数据哈希,如下所示:

<%= f.input :essay, :input_html => {:rows => 5, :placeholder => "Enter some text.", :class => "span6", :data => {:provide => "markdown"} }%>
{:rows=>5,:placeholder=>“输入一些文本。”,:class=>“span6”,:data=>{:provide=>“markdown”}}%>
如果提供大量数据属性,后一种方法可能更好,但是对于单个属性,第一种方法看起来更可读

<%= f.input :essay, :input_html => {:rows => 5, :placeholder => "Enter some text.", :class => "span6", "data-provide" => "markdown" }%>
<%= f.input :essay, :input_html => {:rows => 5, :placeholder => "Enter some text.", :class => "span6", :data => {:provide => "markdown"} }%>