ruby on rails - Convert simple_form tag to bootstrap -
i have simple postgres search form got railscasts:
%h2 search textbook title or isbn = simple_form_for books_path, method: :get = search_field_tag :query, params[:query] = submit_tag "search", name: nil
and bootstrap search form(in haml):
.featurette .featurette-inner.text-center %form.search{:role => "form"} %h3.no-margin-top.h1 search me. .input-group.input-group-lg %input.form-control{:placeholder => "search", :type => "search"} %span.input-group-btn %button.btn.btn-primary{:type => "submit"} search
i "search_field_tag become "input.form-control" , "submit_tag" become "button.btn.btn-primary".
need in combining these 2 not able make search , submit button work. started rails in 2 weeks. support highly appreciated.
thank you!
@jon still don't understand of i'm doing , using f.input opposed =search_field_tag gives me error. able make work though. below used:
.featurette .featurette-inner.text-center %form.search{:role => "form"} %h3.no-margin-top.h1 search me. = simple_form_for books_path, method: :get .input-group.input-group-lg = search_field_tag :query, params[:query], class: "form-control" %span.input-group-btn = submit_tag "search", name: nil, class: "btn btn-success"
Comments
Post a Comment