我们在执行rails g controller controller_name或者rails g model model_name的时候往往会生成相应的assets文件和test,怎么不让rails帮我们生成呢?

在config/application.rb文件中增加下面的代码,其实就是对rails的行为进行修改:

config.generators do |generator|
generator.assets false
generator.test_framework false
end

跳过生成路由文件:

generator.skip_routes true  

What is the difference in Rails commands: --no-test-framework, --skip-test-unit, and -T?

both -T and the --skip-test-unit options are to be used when initially creating the project (rails new), whereas the --no-test-framework is available to later generator commands(rails generate).

Rails generate的时候不生成assets和test的更多相关文章

  1. rails generate model/resource/scaffold的区别

    If you’re just learning Ruby on Rails, you may be confused as to when to generate individual models, ...

  2. 22.Generate Parentheses[M]括号生成

    题目 Given n pairs of parentheses, write a function to generate all combinations of well-formed parent ...

  3. 通过generate解析SQL日志生成xml进行SQL回放

    查看Oracle redo日志来分析SQL执行记录 1)设置Oracle数据字典导出路径参数(可选) shutdown immediatealter system set UTL_FILE_DIR=' ...

  4. LeetCode OJ:Generate Parentheses(括号生成)

    Given n pairs of parentheses, write a function to generate all combinations of well-formed parenthes ...

  5. Shell: how to list all db links in oracle DB to generate a flat file (生成dblink列表文件)

    如果数据库里有上百个DATABASE LINK, 而且同时要管理几十套这样的数据库,在日后改数据库用户密码时就要格外注意是否有DB LINK在使用,否则只改了LOCAL DB 的用户密码,没有级连修改 ...

  6. Rails下cloud datastore的使用

      Rails下cloud datastore的使用 背景 部门有一个项目要用Ruby做 WebAPI,DB使用关系型数据库Cloud Sql和非关系型数据库Cloud Datastore . 还不了 ...

  7. 5-11敏捷开发rails的章节: Rspec(使用方法) ,Slim(使用操作简介)

    Rspec: test Slim :可以取代ERB的模版语言.(简单了解了以下,方便写代码,但我觉得不方便读.还是用原生的html) Webpack管理css: 不再使用app/assets/styl ...

  8. Rails应用系列(1):初识Rails

    第一个Rails应用 Rails是一个"模型-视图-控制器"框架(MVC).是用Ruby写的,所以要对Ruby要有一定的了解才能对rails框架深入学习.其实Ruby与Rails就 ...

  9. Ruby on Rails Tutorial 第六章 用户模型

    1.用户模型(1)数据库迁移Rails默认使用关系数据库存储数据,数据库中的表有数据行组成,每一行都有相应的列,对应数据属性.把列名命名为相应的名字后,ActiveRecord会自动把他们识别为用户对 ...

随机推荐

  1. javascript中使用el表达式获取不到数据问题

    我们通常会在jsp里面使用el表达式,把需要的值传递给 javascript 方法,例如: <p onclick="doSomething(${param})">< ...

  2. USACO 2012 Feb Cow Coupons

    2590: [Usaco2012 Feb]Cow Coupons Time Limit: 10 Sec Memory Limit: 128 MB Submit: 349 Solved: 181 [Su ...

  3. 【C++】指针和new相关

    看黄邦勇帅的笔记. 指针和new之前觉得已经掌握的很好了,可是看了资料还是get到了新知识.记录一下. 1.指针只支持 4 种算术运算符:++,――,+,-.指针只能与整数加减.指针运算的原则是:每当 ...

  4. matlab保存图片成eps格式不全,导致latex中图片显示不全的问题

    我们经常会遇到这样的问题.用将matlab生成的图保存EPS格式后,用GSVIEW打开后,可以看到图片显示不全.遇到这种情况是,我们可以使用dvipdf——dvips的方法来生成PDF,这样生成的pd ...

  5. 利用ResultFilter实现asp.net mvc3 页面静态化

    为了提高网站性能.和网站的负载能力,页面静态化是一种有效的方式,这里对于asp.net mvc3 构架下的网站,提供一种个人认为比较好的静态话方式. 实现原理是通过mvc提供的过滤器扩展点实现页面内容 ...

  6. sourceforge的FTP镜像

    https://www.mirrorservice.org/sites/ftp.sourceforge.net/

  7. 从sizeof(string)到引用计数的漫游

    前言: 说是漫游,其实就是扯,一点一点的扯. 话说之前参加华为的德州扑克比赛,我用C++解析消息的时候碰到一个小问题,就是定长收消息的时候出错,在Linux下调了很久很久,终于发现,sizeof(st ...

  8. HDU 2504.又见GCD-递归

    又见GCD Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submi ...

  9. codeforces Round #440 C Maximum splitting【数学/素数与合数/思维/贪心】

    C. Maximum splitting time limit per test 2 seconds memory limit per test 256 megabytes input standar ...

  10. Coderforces 85 D. Sum of Medians(线段树单点修改)

    D. Sum of Medians time limit per test 3 seconds memory limit per test 256 megabytes input standard i ...