Skip to content

Instantly share code, notes, and snippets.

@namxam
Created December 5, 2014 12:42
Show Gist options
  • Save namxam/508e7b3d4b78b0d3b5a8 to your computer and use it in GitHub Desktop.
Save namxam/508e7b3d4b78b0d3b5a8 to your computer and use it in GitHub Desktop.
Parameter-Übergabe
module ApplicationHelper
# Hier ist der default Wert von data ein leerer Hash
def mein_helper(input_1, data: {})
haml_tag(:picture, data: data)
end
end
.mein-div
= mein_helper 'test_image.jpg', data: { viewport_height: 100 }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment