Guest User

Untitled

a guest
Apr 22nd, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. %p
  2. %label{:for => "hour_name"} Name:
  3. = f.text_field :name
  4. %p
  5. %label{:for => "hour_description"} Description:
  6. = f.text_area :description
  7. / %p.image_chooser
  8. / - for image in Image.all_photos
  9. / %div{:class => "ic_image #{image.class.name.underscore}", :id => "#{image.class.name},#{image.id}"}
  10. / = image_tag image.public_filename(:square)
  11. / = image.name
  12. #viewer
  13. #viewerFrame
  14. - for image in Image.all_photos
  15. = image_tag image.public_filename(:thumb)
  16. %span#btn1
  17. prev
  18. %span#btn2
  19. next
  20.  
  21. = f.hidden_field :image_type
  22. = f.hidden_field :image_id
  23. = f.hidden_field :associable_type
  24. = f.hidden_field :associable_id
  25.  
  26. %script
  27. :plain
  28. $('.ic_image').click(function() {
  29. $('.ic_image').removeClass('ic_selected_image');
  30. $(this).addClass('ic_selected_image');
  31. $('#image_association_image_type').val(this.id.split(',')[0]);
  32. $('#image_association_image_id').val(this.id.split(',')[1]);
  33. });
Add Comment
Please, Sign In to add comment