Skip to content

Instantly share code, notes, and snippets.

@kaochenlong
Last active October 24, 2018 14:10
Show Gist options
  • Save kaochenlong/121905946c17c94e671c7edda3e4e68f to your computer and use it in GitHub Desktop.
Save kaochenlong/121905946c17c94e671c7edda3e4e68f to your computer and use it in GitHub Desktop.
# 練習:請印出從 1 到 100 之間所有的單數。
# 練習:請印出從 1 到 100 之間所有的單數的總和。
# 練習:改良版土砲 times 方法
5.my_times { |i| puts i } # 印出數字 0 ~ 4
# 練習:土砲 select 方法
[1, 2, 3, 4, 5].my_select { |i| i.odd? } # 只印出單數 1, 3, 5
@FRedwuSong
Copy link

FRedwuSong commented May 9, 2018

姓名 : 吳松翰
謝謝龍哥 煩請閱覽
土砲方面 還在思考中

@shaomummy
Copy link

姓名: 邵子晉
繳交作業: 作業0505

@DavidRails
Copy link

老師你好, 作業如連結, https://user-images.githubusercontent.com/44360489/47285585-053c4900-d61e-11e8-97cc-3dadf6212cf1.jpg
也看了 Scaffold 的 model/view/controller 的 code, 有比較之前了解, 特別是在 class/module 和 methods 的部份,
但是在 (1) Rails API (2) view .erb 和 .jbuilder 因為沒有前端的背景, 所以不了解 (3) symbol 的用法 似乎會被當作 method 像是
before_action :set_post, only: [:show, :edit, :update, :destroy], 這部份也不了解,下次上課再請教您,謝謝。

David

@YanLinGitHub
Copy link

Ruby on Rails Practice Week 2,麻煩龍哥了。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment