index.html.haml 925 B

1234567891011121314151617181920212223242526
  1. -# This file is app/views/movies/index.html.haml
  2. %h1 All Movies
  3. = form_tag movies_path, :method => :get, :id => "ratings_form" do
  4. Include:
  5. - @all_ratings.each do |rating|
  6. = rating
  7. = check_box_tag "ratings[#{rating}]", 1, @ratings_array.include?(rating), :id => "ratings_#{rating}"
  8. = submit_tag 'Refresh', :id => "ratings_submit"
  9. %table#movies
  10. %thead
  11. %tr
  12. %th{:class => @title_header}= link_to("Movie Title", {controller: "movies", sort: "title"}, {:id => "title_header"})
  13. %th Rating
  14. %th{:class => @release_date_header}= link_to("Release Date", {controller: "movies", sort: "release_date"}, {:id => "release_date_header"})
  15. %th More Info
  16. %tbody
  17. - @movies.each do |movie|
  18. %tr
  19. %td= movie.title
  20. %td= movie.rating
  21. %td= movie.release_date
  22. %td= link_to "More about #{movie.title}", movie_path(movie)
  23. = link_to 'Add new movie', new_movie_path