Curated list of episodes, bundled to help you on your learning path!
Videos of tech, infrastructure, hardware and software which non-instructional by nature.
Articles around software and tutorials.
Show your love and support while looking fancy.
Got a question or want to chat about a topic? Let's talk!
hash[:password] == password
array = [] array << { username: 'username', password: 'password' }
User.new(user_params)
def user_params allowed_params = [].tap do |array| array << :first_name array << :last_name array << :admin if current_user.admin? end params.require(:user).permit(allowed_params) end
But seriously, why [].tap?
A trivial typo in config.ru -
However, in many other situations doing a [].tap or {}.tap is pretty handy in conditionally adding items. For example,