刘华佼的全栈学习记录

如何新建一个讨论群

| Comments

目标一:

讨论群要有“标题”与“叙述”

步骤一:设计Group的model架构

rails g model group title:string description:text

rake db:migrate

步骤二:产生groups controller

rails g controller groups

步骤三:建立index action和index的页面

修改app/controlers/groups_controller.rb

touch app/views/groups/index.html.erb

步骤四:在routing上挂上groups

resources :groups

目标二:

使用者要可以看到“讨论群一览表”

步骤一:修改routing

root 'groups#index'

Comments

comments powered by Disqus