This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{{#each suggestedUsers}} | |
<li> | |
{{selectedUser}} | |
<a href='#' {{action completeUser}} {{bindAttr data-username="this"}}>{{this}}</a> | |
</li> | |
{{/each}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Account.transaction do | |
david.withdrawal(100) | |
mary.deposit(100) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def make_new(obj, hash) | |
new_ob = type.new | |
# Two approaches - 1st: You can use the array notation [] on an activerecord to use it like a hash | |
hash.each do {|key, value| new_ob[key] = value } | |
# Or you can send to the method using period: | |
hash.each do {|key, value| new_ob.send("#{key.to_s}=", value) } | |
end |
NewerOlder