rails-create-action-readme-v-000

时间:2024-03-11 09:56:50
【文件属性】:
文件名称:rails-create-action-readme-v-000
文件大小:49KB
文件格式:ZIP
更新时间:2024-03-11 09:56:50
Ruby 建立动作 在本课程中,我们将编写一个create动作—在“ CRUD ”生命周期中的“ C ”,该动作将保存一个新的Post对象,然后重定向到新创建的post的show页面。 在实现此功能之前,我们首先打开一个Rails控制台会话并手动创建一条记录: post = Post . new post . title = "Title Goes Here" post . description = "Desc goes here..." post . save 使用此语法,您可以手动创建带有title和description属性的新过Post记录。 在控制台中运行save方法之后,您将看到类似于以下内容的输出: (0.1ms) begin transaction SQL (0.3ms) INSERT INTO " posts " ( " title " , " description
【文件预览】:
rails-create-action-readme-v-000-master
----.gitignore(642B)
----app()
--------mailers()
--------assets()
--------models()
--------helpers()
--------views()
--------controllers()
----config.ru(153B)
----LICENSE.md(1KB)
----bin()
--------rails(141B)
--------setup(920B)
--------bundle(129B)
--------spring(490B)
--------update(782B)
--------rake(90B)
----log()
--------.keep(0B)
--------development.log(3KB)
--------test.log(41KB)
----CONTRIBUTING.md(2KB)
----db()
--------test.sqlite3(20KB)
--------migrate()
--------seeds.rb(343B)
--------development.sqlite3(20KB)
--------schema.rb(992B)
----public()
--------robots.txt(202B)
--------422.html(2KB)
--------favicon.ico(0B)
--------500.html(1KB)
--------404.html(2KB)
----spec()
--------spec_helper.rb(4KB)
--------rails_helper.rb(2KB)
--------features()
----README.md(6KB)
----vendor()
--------assets()
----config()
--------cable.yml(116B)
--------spring.rb(111B)
--------boot.rb(128B)
--------secrets.yml(965B)
--------database.yml(552B)
--------routes.rb(158B)
--------environments()
--------environment.rb(128B)
--------application.rb(544B)
--------locales()
--------puma.rb(2KB)
--------initializers()
----lib()
--------assets()
--------tasks()
----Gemfile(1KB)
----.learn(132B)
----Rakefile(249B)

网友评论