当前位置: 动力学知识库 > 问答 > 编程问答 >

html - Rails styling form tag with materialize css

问题描述:

I am trying to basically add the search bar style from materialize css (shown below), and apply to to the form_tag I've drafted in rails. I tried simply inserting the rails block in between the label and the i class, and while the style was mostly correct, the search function was lost, as each query resulted a rescue call being made (not shown here).

Materialize Css

<nav>

<div class="nav-wrapper">

<form>

<div class="input-field">

<input id="search" type="search" required>

<label for="search"><i class="material-icons">search</i></label>

<i class="material-icons">close</i>

</div>

</form>

</div>

</nav>

Rails Code

<%= form_tag "/pages/home", method: "get" do %>

<%= label_tag(:q, "Search for:") %>

<%= text_field_tag(:q) %>

<%= submit_tag("Search") %>

<p>You searched:</p>

<%= params["q"] %>

<% end %>

分享给朋友:
您可能感兴趣的文章:
随机阅读: