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