Skip to content

Instantly share code, notes, and snippets.

@manusajith
Last active December 10, 2015 22:08
Show Gist options
  • Save manusajith/4500141 to your computer and use it in GitHub Desktop.
Save manusajith/4500141 to your computer and use it in GitHub Desktop.
Ruby and Ruby on Rails Tips for beginers
=begin
Rails' index_by: the easy way to convert an Array to a Hash.
=end
Post.all.index_by(&:title)
=begin
If u r nt sure wat files a Rails generator wud create for u jst add -p for a dry run
=end
rails g model Blog -p
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment