Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/61.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_Forms - Fatal编程技术网

Html 如何在图像位于范围内的位置制作按钮

Html 如何在图像位于范围内的位置制作按钮,html,ruby-on-rails,forms,Html,Ruby On Rails,Forms,我有html格式的 <form id="contact-form" action="#0" class="ae-form--full"> <input type="text" placeholder="* Name" required> <input type="email" placeholder="* Email" required> <textarea placeholder=

我有html格式的

<form id="contact-form" action="#0" class="ae-form--full">
            <input type="text" placeholder="* Name" required>
            <input type="email" placeholder="* Email" required>
            <textarea placeholder="Message ..." cols="30" rows="4"></textarea>
            <p class="au-xs-ta-right au-pt-4 group-buttons"><a href="#0" class="arrow-button arrow-button--right arrow-button--out">Send<span class="arrow-cont">
                  <svg>
                    <use xlink:href="assets/img/symbols.svg#arrow"></use>
                  </svg></span></a></p>
          </form>


现在,我想知道如何使用类创建submit按钮,以及svg图像必须放置在跨度中的什么位置

首先,您应该使用rails表单帮助程序,如 我喜欢使用

但你现在看到的应该是这样的

<%= form_for @contact do |f| %>
  <%= f.label :name %>:
  <%= f.text_field :name %><br />

  <%= f.label :email %>:
  <%= f.text_field :email %><br />

  <%= f.label :message %>:
  <%= f.text_area(:message, cols: 20, rows: 40) %><br />
    <%= button_tag(type: 'submit', class: "btn btn-primary") do %>
      Save <span class="icon-ok icon-white"></span> 
    <% end %>
<% end %>

我希望这有帮助

首先,您应该像
<button type="submit" class="btn btn-primary" id="get_drug_search_results">
   <span class="textm"><%= t("labels.find_result") %></span>
   <span class="icon "><%=image_tag("magnifying-glass-grey.png", width: 20, height: 20,:id=> "image")%></span>
</button>
我喜欢使用

但你现在看到的应该是这样的

<%= form_for @contact do |f| %>
  <%= f.label :name %>:
  <%= f.text_field :name %><br />

  <%= f.label :email %>:
  <%= f.text_field :email %><br />

  <%= f.label :message %>:
  <%= f.text_area(:message, cols: 20, rows: 40) %><br />
    <%= button_tag(type: 'submit', class: "btn btn-primary") do %>
      Save <span class="icon-ok icon-white"></span> 
    <% end %>
<% end %>
我希望这会有所帮助


<button type="submit" class="btn btn-primary" id="get_drug_search_results">
   <span class="textm"><%= t("labels.find_result") %></span>
   <span class="icon "><%=image_tag("magnifying-glass-grey.png", width: 20, height: 20,:id=> "image")%></span>
</button>
“图像”)%%>

“图像”)%%>

不清楚您的意思。不清楚您的意思。好的,但我想我可能是因为我丢失了帖子部分,或者是因为我丢失了一些东西和svg图像。您想提交表单吗?是的,我想这样做。下面是我尝试使用的示例:让我知道此帮助是否使用简单表单。我现在看到一个按钮,我想看到一个链接,但我错过了按钮后的svg图像,但我想我失去了文章部分,或者我错过了什么,我错过了svg图像。你想提交表单吗?是的,我想这样做。下面是我尝试使用的示例:让我知道此帮助是否使用简单表单。我现在看到一个按钮,我想看到一个链接,我错过了按钮后面的svg图像
<button type="submit" class="btn btn-primary" id="get_drug_search_results">
   <span class="textm"><%= t("labels.find_result") %></span>
   <span class="icon "><%=image_tag("magnifying-glass-grey.png", width: 20, height: 20,:id=> "image")%></span>
</button>