Skip to content

Instantly share code, notes, and snippets.

@chikadance
Created February 8, 2014 07:13
Show Gist options
  • Save chikadance/8877868 to your computer and use it in GitHub Desktop.
Save chikadance/8877868 to your computer and use it in GitHub Desktop.
rails: #content_for implement
class C
def content_for(smth, content)
if smth == 'smth'
m do
p "smth #{content}"
end
elsif smth == 'smth2'
m do
p "smth2 #{content}"
end
end
end
def m
yield "smth"
yield "smth2"
end
end
C.new.content_for('smth', 'a content')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment