Help on index controller correction

I am currently wanting to add a search button on my screen …
I have everything up and running …
The only problem I’m having is …
My get is not fetching.
Always show full index

What could be wrong, and how to correct?


<%= form_for @conn, vaga_path(@conn, :index), [method: :get], fn f -> %>
      <%= search_input f, :query, placeholder: "Buscar", class: "form-control mr-sm-2" %>
      <%= submit "Buscar", class: "btn btn-outline-success my-2 my-sm-0" %>


  def index(conn, params, user) do
    page = Vaga
            |> Repo.paginate(params) <<< My pagination
   active_vagas = Registro.list_vagas("ativa") <<< Show only active result
   active_search = Registro.list_search(params) <<< Here would be my search.
    render(conn, "index.html", vagas: active_vagas, user: user, vagas: page.entries, page: page, vagas: active_search)

I was able to solve,
It was typing failure.
Thank you

1 Like