Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module CabinetsHelper
- def component(component)
- haml_tag :div, :id => dom_id(component), :class => "component_display " + component.elevation.to_s do
- haml_concat component_link_to_function(component)
- end
- end
- def component_link_to_function(component)
- link_to_function "alert('test')" do
- component_image( component)
- end
- end
- def component_image(component)
- haml_concat image_tag component.image, :id => dom_id(component), :class => "test", :height => component.image_height
- haml_tag :div, :class => "component_border" do
- image_tag '/images/selected.png', :id => "border_" + dom_id(component), :class => "component_border", :height => component.image_height + 10
- end
- end
- end
- # and in your view
- - component( @whatever )
Add Comment
Please, Sign In to add comment