• Sign in
  • Sign up 
  • Welcome
  • FAQ
  • Block Explorer 
  • Night Mode
  • Stolen Accounts Recovery 
  • Change Account Password 
  • Vote for Witnesses 
  • Hive Proposals 
  • OpenHive Chat 
  • Developer Portal 
  • Hive Whitepaper 
  • Privacy Policy
  • Terms of Service
logo
  • Posts
  • Proposals
  • Witnesses
  • Our dApps
LoginSign up

Rails Tip #01 ===> Symbol to Proc

bilal-haider (58)in #rails • 7 years ago

The Task

Get all the users from Database
Get only the names
Get them all in upCase

 User.all.collect(&:name).collect(&:upcase)

Screenshot from 2018-04-20 10-21-04.png

#tips #ruby #rubyonrails
7 years ago in #rails by bilal-haider (58)
$49.96
  • Past Payouts $49.96
  • - Author $39.27
  • - Curators $10.69
126 votes
  • upme: $20.44
  • appreciator: $17.09
  • inertia: $10.85
  • ashe-oro: $0.71
  • jdcrunchman: $0.31
  • bago: $0.29
  • thescubageek: $0.06
  • bilal-haider: $0.02
  • johndoer123: $0.01
  • serialfiller: $0.01
  • umarsuperb: $0.00
  • nithog: $0.00
  • ulsarthegreat: $0.00
  • tuanis: $0.00
  • tanimur: $0.00
  • damotil: $0.00
  • syanaa: $0.00
  • awy: $0.00
  • kirbyjr1977: $0.00
  • seejc: $0.00
  • and 106 more
Reply 1
Sort:  
  • Trending
    • Trending
    • Votes
    • Age
  • [-]
    syanaa (40)
     7 years ago  

    Subhanallah very nice my friend

    $0.02
    • Past Payouts $0.02
    • - Author $0.02
    • - Curators $0.00
    1 vote
    • bilal-haider: $0.02
    Reply