Command that creates the actual model file that holds all the methods unique to the model and the business rules, a unit test file for performing test-driven development,fixtures to use with the unit tests, and a Rails migration
Questions tagged [rails-generate]
56 questions
0
votes
1 answer
rails generate ckeditor:install for rails 2.3?
I'm trying to install and set up this gem - https://github.com/galetahub/ckeditor, but when I follow the instructions and run:
rails generate ckeditor:install
I get an error because "rails generate" is a rails 3 command (I think?!).. so my question…

Alex Fox
- 1,175
- 2
- 15
- 27
0
votes
1 answer
Rails generate scaffold creates in wrong places
On a fresh project, rails generate behaves strangely. I did:
rails new pm
cd pm/
rake db:migrate
rails generate controller home index
rails generate scaffold Entry title:string content:text date:date
Now my dir looks like this: What went…

groovehunter
- 3,050
- 7
- 26
- 38
0
votes
1 answer
running a constructer from within a controller
So I'm attempting to run a generator from within a controller
the idea being that i could generate a scaffold from within a rails application
for testing purposes ive created a small generator that creates an initializer with no real content. i've…

Ben
- 21
- 3
0
votes
1 answer
Ruby on Rails generate controller giving an error
I'm currently trying to generate a controller in rails with the command:
rails generate controller Songs index upload delete
But I get the error:
/Users/lucasdobbins/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.5/lib/rails/commands.rb:15:in…

led
- 361
- 1
- 4
- 9
0
votes
1 answer
ruby on rails *_url returning wrong address
I'm sending emails from rails, and using the *_url helper to generate urls.
However, these links are starting:
https://admin.test.website.co.uk/
(which is what the URL used to start with), whereas they should…

tiswas
- 2,041
- 7
- 31
- 43
0
votes
1 answer
How to pass class_name Option to Generator?
I am using Rails' generators to produce things like models in my app.
My models are commonly using the class_name option on relations.
Is it possible to generate a model from the command line and pass the value for class_name? I specifically want…

Billy Blob Snortin
- 1,101
- 3
- 11
- 17
0
votes
1 answer
Installing petergate returns error `Could not find generator 'petergate:install'`
I keep getting this error. The full text is as follows:
$ rails g petergate:install
Running via Spring preloader in process 96515
Could not find generator 'petergate:install'. Maybe you meant 'devise:install', 'responders:install' or…

Joe
- 273
- 5
- 17
0
votes
1 answer
Generating sample version of all emails in a Rails application
What is the best way to generate a sample/test version of every email that can be produced by a Rails application (for example, so that someone else can look them over to make content changes)? If there isn't an easy way by default, are there any…

jrdioko
- 32,230
- 28
- 81
- 120
0
votes
1 answer
Define reference name
Is there a way to define reference name with "rails generate" command?
There is table A with two fields - a1 and a2: references to table B.
user5169597
0
votes
1 answer
uninitialized constant with rails_admin
I have added the gem rails_admin. It works well at first but whenever I want to edit or look up something this problem occurs.
I tried to remove the line but it could not find where is it located in the app. I read that many ran into a similar…

hekmat
- 93
- 2
- 8
0
votes
1 answer
Skipping Active Record breaks Rails Generator
I created a new Rails project with the -O --api flags turned on, and rails g model is now broken for me: it does nothing and simply says "running via Spring preloader" (its not a Spring bug as I've tried removing Spring) and returns.
After that, I…

xuq01
- 588
- 4
- 17
0
votes
1 answer
Syntax for rails g migration with Space
hello.
I'm trying to add a column called product_size to my order_items table in my schema.
Do I do this by:
$ rails g migration add_product_size_to_order_items
or
$ rails g migration add_product_size_to_OrderItem
or otherwise?
Thanks!

slave_unit
- 27
- 6
0
votes
2 answers
0
votes
1 answer
creating database fields without „nifty generators” rails
Is there a way in Rails to manipulate database fields and corresponding accessor methods without the „nifty generators” ?
I want users, insofar they are privileged, to be able to manipulate the database structure, that is, at least, to add or delete…

von spotz
- 875
- 7
- 17
0
votes
0 answers
I can't make rails generate controller
I've ruby 1.9.3 and rails 3.1
I'm try to generate a controller with this syntax:
$rails generate controller sessions new create failure
but respond me with this…

Uriel
- 1
- 1