Hi,
I am a bit new at rails, so I’m not sure how to approach this:
I have a view with a search box that calls a controller/model outside
of the view. So the view I am working with is called ‘groups’ and I
make a search to people, in another controller. I’d like the result
of the search to get sent back to my view under groups.
Here’s what I have in the view:
show.erb:
<% form_tag ({ :controller=> ‘people’, :action=> ‘index’}, :method=>
‘get’) do %>
Name: | <%= text_field_tag :search_name, params[:search_name]%> <%= submit_tag "Search", :name=> nil %> |
<%end %>
So instead of the result rendering in index under ‘people’, I’d like
to get the array back and render a list of people in groups. I tried
working with partials, but the issue is I need to get the array back
into this view, so I can pass it to a partial.
My controller code in people looks like this (I put the logic in the
model)
def people_search
@people_tree_searches = PeopleTreeV.search(params[:search_name])
end
end
any pointers are appreciated
thanks