bufallo 에서 action 생성명령은 g(generate) a(action) 이다.
buffalo g a 액션명
buffalo g action 액션명
buffalo g actions 액션명

하지만 그냥 액션명을 하면
actions 아래에 바로 생긴다.
로직이 많아지면 복잡해지므로 package를 추가하는 것이 좋다
buffalo g a te/tt show index create 를 하면
actions/te/ttt.go
actions/te/ttt_test.go 파일이 생성된다.

뒤에 show, index, create는 routing 과 template 파일을 생성하기 위한 것임.

추가한 action을 삭제하려면 d(destroy) 를 사용한다
buffalo d action 액션명

방금 추가한 te/ttt를 삭제
buffalo d action te/ttt
Want to remove actions? (y/N)y
INFO[0003] - Deleted actions/te_ttt.go                  
INFO[0003] - Deleted actions/te_ttt_test.go
INFO[0003] - Deleted References for te_ttt in actions/app.go

actions/app.go 에 가보면 route에 추가되어있던 te/ttt 관련사항이 삭제된 것을 확인할 수 있다.

728x90
BLOG main image
"그게 뭐 어쨌다는 거냐?" 늘 누가 나에게 나에대한 말을할 때면 이말을 기억해라. by nobang

카테고리

nobang이야기 (1933)
Life With Gopro (7)
Life With Mini (79)
Diary (971)
너 그거 아니(do you know) (162)
난 그래 (159)
Study (290)
속지말자 (10)
Project (34)
Poem (15)
Song (0)
Photo (113)
낙서장 (45)
일정 (0)
C.A.P.i (2)
PodCast (0)
nobang (27)
고한친구들 (4)
recieve (0)
History (0)
android_app (2)

최근에 올라온 글

최근에 달린 댓글

최근에 받은 트랙백

Total :
Today : Yesterday :