Guest User

Untitled

a guest
Oct 23rd, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. module CabinetsHelper
  2. def component(component)
  3. haml_tag :div, :id => dom_id(component), :class => "component_display " + component.elevation.to_s do
  4. haml_concat component_link_to_function(component)
  5. end
  6. end
  7.  
  8. def component_link_to_function(component)
  9. link_to_function "alert('test')" do
  10. component_image( component)
  11. end
  12. end
  13.  
  14. def component_image(component)
  15. haml_concat image_tag component.image, :id => dom_id(component), :class => "test", :height => component.image_height
  16. haml_tag :div, :class => "component_border" do
  17. image_tag '/images/selected.png', :id => "border_" + dom_id(component), :class => "component_border", :height => component.image_height + 10
  18. end
  19. end
  20. end
  21.  
  22. # and in your view
  23. - component( @whatever )
Add Comment
Please, Sign In to add comment