Javascript 如何在Rails的输入标记中存储erb值?

Javascript 如何在Rails的输入标记中存储erb值?,javascript,ruby-on-rails,ruby,forms,erb,Javascript,Ruby On Rails,Ruby,Forms,Erb,当我试图使用value在输入标记中显示一个人的名字时,只要有空格,名字就会被截断。所以当它应该说John Doe时,输入只是显示John。有人知道为什么它会在我的rails应用程序中这样做吗?数据库是正确的,如果我使用标记,所有内容都会正确显示 form class="panel data-abide" action="" id="form1"> <fieldset > <legend>Please Enter the Information Below

当我试图使用value在输入标记中显示一个人的名字时,只要有空格,名字就会被截断。所以当它应该说John Doe时,输入只是显示John。有人知道为什么它会在我的rails应用程序中这样做吗?数据库是正确的,如果我使用标记,所有内容都会正确显示

form class="panel data-abide" action="" id="form1">
  <fieldset >
    <legend>Please Enter the Information Below</legend>

  <div class="row">
    <div class="large-4 columns">
      <label>Adjuster's Name
        <input class="adjustorInfo" value=<%= @adjuster.adjuster_name %>/>
     </label>
    </div>
 </div>
formclass=“panel data”action=”“id=“form1”>
请在下面输入信息
理算师姓名

这是因为
value
标记的值没有放在引号中。 你应该把它改成

<input class="adjustorInfo" value="<%= @adjuster.adjuster_name %>"/>


当您不带引号地传递它时,相应的HTML如下所示

<input class="adjustorInfo" value=John Doe/>
<input class="adjustorInfo" value="John Doe"/>

然后转换成你所看到的

<input class="adjustorInfo" value="John"/>

将其传递到引号中形成预期值