N
N
Nikita2016-07-15 19:16:28
Ruby on Rails
Nikita, 2016-07-15 19:16:28

How to remove unnecessary parameters from a form?

Hello!
There is the following form:

<%= form_tag({controller: "static_pages", action: "search"}, method: "get") do %>
    <%= text_field_tag "number", "Поиск по артиклу (номеру детали)", class: "part_search_field", onClick: "if(this.value='Поиск по артиклу (номеру детали)')this.value=''",
                                       onBlur: "if(this.value=='')this.value='Поиск по артиклу (номеру детали)'" %>
    <%= submit_tag :"Search", class: "part_search_button" %>
  <% end %>

I get the following parameters as input:
Parameters: {"utf8"=>"✓", "number"=>"13.0460-5996.2", "commit"=>"Search"}

"utf8" and "commit" are passed automatically, but I don't need them. Is there any way to get rid of them?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton, 2016-07-15
@niks123123

render json: params[:search].inspect

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question