Guest User

Untitled

a guest
May 22nd, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. ## Family Search Form
  2.  
  3. <% title 'Search Families' %>
  4.  
  5. <% form_for @search, :url => enrollment_process_families_path, :html => { :class => 'error_handling' } do |f| -%>
  6. <ol>
  7. <% f.fields_for @search.conditions do |families| %>
  8. <%= families.select :any, [["All", false], ["Any", true]]%>
  9. <% families.fields_for families.object.guardians do |guardian| %>
  10. <li>
  11. <label>Last Name</label>
  12. <%= guardian.text_field 'last_name_starts_with', :label => 'Last name' %>
  13. </li>
  14. <li>
  15. <label>Last Name</label>
  16. <%= guardian.text_field 'last_name_starts_with', :label => 'Last name' %>
  17. </li>
  18. <li><%= guardian.submit 'Search' %></li>
  19. <% end %>
  20. <% end %>
  21. </ol>
  22. <% end %>
  23.  
  24.  
  25. ## Controller
  26.  
  27. class EnrollmentProcessController < ApplicationController
  28.  
  29. def family_index
  30. @families = family_search_object.all
  31. end
  32.  
  33. def family_search
  34. @search = family_search_object
  35. end
  36.  
  37. private
  38.  
  39. def family_search_object
  40. #Intentionally Search All Families in System (not just those the user has access to)
  41. search = Family.new_search(params[:search])
  42. end
  43. end
Add Comment
Please, Sign In to add comment