Filipe Fernandes
Filipe Fernandes

Reputation: 167

Skip jbuilder files when I generate a scaffold?

When I scaffold I don't want it to generate these files:

invoke    jbuilder
create      app/views/tests/index.json.jbuilder
create      app/views/tests/show.json.jbuilder

But how? in my application.rb I have this:

config.generators do |g|
  g.assets            false
  g.helper            false
  g.test_framework    nil
end

Upvotes: 15

Views: 4995

Answers (3)

stephenmurdoch
stephenmurdoch

Reputation: 34643

If you haven't created the application yet, then you can do the following:

rails new hello_world --skip-jbuilder

Upvotes: 2

Matthias
Matthias

Reputation: 1953

Deleting or commenting out jbuilder from you Gemfile will do the trick.

https://stackoverflow.com/a/24104811/5521564

Upvotes: 3

Kirti Thorat
Kirti Thorat

Reputation: 53038

Use

config.generators.jbuilder = false

or

config.generators do |g|
  g.assets            false
  g.helper            false
  g.test_framework    nil
  g.jbuilder          false
end

Upvotes: 31

Related Questions