Advertisement
Guest User

Untitled

a guest
Nov 26th, 2014
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. #print_controller.rb
  2.  
  3. def show
  4. @reports = Report.find_by_some_attribute(...
  5.  
  6. #show.html.erb
  7.  
  8. <%- @reports.each do |report| -%>
  9. <%= report.created_at -%>
  10. <%- end -%>
  11.  
  12. XYZ.all.each do |xyz|
  13. some(xyz)
  14. end
  15.  
  16. Report.find_by_created_at("2013-11-12 14:43:44.11824")
  17.  
  18. def show
  19. @reports = Report.where(:attribute => value)
  20. end
  21.  
  22. it will get the all records basic on that value
  23.  
  24. <h1>views/abc/show.html.erb</h1>
  25. <% @reports.each do |report| %>
  26. <%= report.attribute_name %>
  27. <%end%>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement