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 model - field constraints?
I know that I can generate a model and set a constraint such as uniq by doing "rails generate model field1:string:uniq", for example. Is there a way I can set a "not null" constraint?

jeffdh5
- 75
- 2
- 8
0
votes
1 answer
Reuse methods in a Rails generator
I'm writing a series of Rails generators that will share several of the same methods. I would like to abstract these methods into a module or class of their own to be reused (but not automatically fired) within each of my generators.
My latest…

seancdavis
- 2,739
- 2
- 26
- 36
0
votes
1 answer
rails generate ckeditor:install could not load generator
I added to the Gemfile
gem 'ckeditor'
also I tried to add
gem 'ckeditor', :git => 'git://github.com/galetahub/ckeditor.git'
or
gem 'ckeditor', :git => 'git://github.com/galetahub/ckeditor.git', :branch =>'rails3'
Bundle install is successfuly…

boberobor
- 21
- 4
0
votes
1 answer
rails generate model(s) through configuration file
There are possibilities to generate models (and migration) through a configuration file? I have so much table and i want create them (all the time) with a simple step.

misterwolf
- 424
- 4
- 14
0
votes
1 answer
Calling created Objects in Rails Scaffold
I am new to Rails and creating a football results app, I did a rails generate Scaffold Team name:string form:string then I added a few teams to the table, my next step I tried was to create a Fixtures table that stores teams, so I did rails generate…

user1014888
- 431
- 2
- 7
- 14
0
votes
1 answer
Rails - generate scaffold for multi select
I used the following method to generate scaffold for platform list in our app:
rails generate scaffold platform name:string url:string country:string
I would like to still use scaffold possibility to add additional attributes, like type and gender,…

Cninroh
- 1,796
- 2
- 21
- 37
0
votes
1 answer
rails generate script for adding new pages?
Creating a new page (within an existing controller) in rails is an easy 3 step process; any way of automating this? Creating a generate script that does the following maybe:
add method to controller:
def newPage
end
add route(s)
get…

twinturbotom
- 1,504
- 1
- 21
- 34
0
votes
1 answer
Rails Generate Error
Everytime I attempt to use rails generate, I get the following error message. Not sure what Im doing wrong:
rails generate controller Say hello…

uknj
- 89
- 1
- 13
0
votes
4 answers
How do I generate dynamic items dynamically?
I'm looking for a way to append elements with javascript using javascript. Basically I have two lists of items. One has a list of items with an "ADD" button (using "link_to_remote") and the other has a list of items with a "REMOVE" button (using…

humble_coder
- 2,777
- 7
- 34
- 46
0
votes
2 answers
Rails generate scaffold -> NameError: uninitialized constant
I've got this stupid thing... I'm sure I just miss something obvious but yahoogling didn't solve the problem.
All I do is
rails new TestApp
and
cd TestApp
rails generate scaffold User name:string age:integer
bundle exec rake db:create
bundle exec…

EasierSaidThanDone
- 1,877
- 4
- 20
- 29
-2
votes
2 answers
Syntax Error every Time I run a rails command
I'm trying to generate pages for a new rails project but I keep getting this error.
$ rails generate controller pages home
/Users/reidwahlbrink/.rvm/gems/ruby-2.1.2/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:241:in…

rbrink63
- 3
- 1