没有合适的资源?快使用搜索试试~ 我知道了~
显示关联rails-online-web-ft-011419
共92个文件
rb:45个
erb:9个
keep:9个
需积分: 5 0 下载量 164 浏览量
2021-02-13
14:34:08
上传
评论
收藏 60KB ZIP 举报
温馨提示
显示关联Rails 目标 学完本课后,您应该能够... 创建has_many和belongs_to关联。 通过控制台和db/seeds.rb构建关联的数据。 使用关联提供的方法查询关联数据。 将关联数据嵌入视图中。 遍历显示单个实例的视图内的关联数据。 博客类别 在本课程中,我们将设置一个博客管理面板,以便可以创建Post对象,将其与Category对象相关联,并按Category列出。 模型 首先,就像上一课一样,我们将建立关联的模型: # app/models/post.rb class Post < ActiveRecord :: Base belongs_to :category end # app/models/category.rb class Category < ActiveRecord :: Base has_many :posts end 种子数据
资源推荐
资源详情
资源评论
收起资源包目录
displaying-associations-rails-online-web-ft-011419-master.zip (92个子文件)
displaying-associations-rails-online-web-ft-011419-master
bin
update 782B
rake 90B
setup 920B
spring 507B
rails 141B
bundle 129B
vendor
assets
javascripts
.keep 0B
stylesheets
.keep 0B
config
locales
en.yml 634B
database.yml 552B
initializers
filter_parameter_logging.rb 194B
assets.rb 486B
wrap_parameters.rb 485B
new_framework_defaults.rb 1KB
backtrace_silencers.rb 404B
session_store.rb 142B
cookies_serializer.rb 244B
application_controller_renderer.rb 216B
mime_types.rb 156B
inflections.rb 647B
puma.rb 2KB
application.rb 486B
routes.rb 225B
boot.rb 128B
spring.rb 111B
cable.yml 116B
secrets.yml 965B
environment.rb 128B
environments
test.rb 2KB
development.rb 2KB
production.rb 3KB
db
seeds.rb 343B
migrate
20160113011150_add_post_status_to_posts.rb 122B
20160113163910_add_category_id_to_posts.rb 122B
20160113011041_create_authors.rb 203B
20160113011820_add_author_id_to_posts.rb 118B
20151230232412_create_posts.rb 186B
20160113163851_create_categories.rb 169B
schema.rb 1KB
Rakefile 249B
app
models
post.rb 36B
author.rb 56B
category.rb 40B
concerns
.keep 0B
.keep 0B
assets
images
.keep 0B
javascripts
application.js 661B
categories.coffee 211B
stylesheets
categories.scss 181B
application.css 686B
controllers
categories_controller.rb 603B
concerns
.keep 0B
posts_controller.rb 559B
application_controller.rb 204B
views
layouts
application.html.erb 299B
categories
index.html.erb 129B
edit.html.erb 230B
new.html.erb 229B
show.html.erb 83B
posts
index.html.erb 116B
edit.html.erb 508B
new.html.erb 507B
show.html.erb 117B
mailers
.keep 0B
helpers
application_helper.rb 29B
CONTRIBUTING.md 2KB
Gemfile 1KB
Gemfile.lock 5KB
.rspec 11B
spec
models
post_spec.rb 419B
author_spec.rb 451B
category_spec.rb 222B
controllers
categories_controller_spec.rb 401B
posts_controller_spec.rb 388B
views
categories
show.html.erb_spec.rb 401B
edit.html.erb_spec.rb 423B
posts
show.html.erb_spec.rb 511B
edit.html.erb_spec.rb 518B
rails_helper.rb 3KB
spec_helper.rb 4KB
LICENSE.md 1KB
.gitignore 642B
.learn 68B
lib
tasks
.keep 0B
assets
.keep 0B
public
404.html 2KB
robots.txt 202B
500.html 1KB
422.html 2KB
favicon.ico 0B
README.md 5KB
config.ru 153B
共 92 条
- 1
资源评论
空气安全讲堂
- 粉丝: 43
- 资源: 4795
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 雷克沙u盘加密软件windows客户端
- JavaSwing订单管理系统.zip
- 数据库管理工具:dbeaver-ce-23.2.4-macos-aarch64.dmg
- 一个能够使用的幻兽帕鲁修改器
- java期末大作业课程设计学生成绩管理系统源码+数据库(高分项目)
- 数据库管理工具:dbeaver-ce-23.2.2-stable.x86-64.rpm
- 数据库管理工具:dbeaver-ce-23.2.2-macos-x86-64.dmg
- 数据库管理工具:dbeaver-ce-23.2.2-macos-aarch64.dmg
- 数据库管理工具:dbeaver-ce-23.1.5-stable.x86-64.rpm
- 以下是一些适用于英语六级作文的万能句型模板,涵盖了引言、正文和结论部分的各类表达方式.docx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功