Hey guys,
i have just set up a database and ruby on rails application. I then did
a ruby script\generate Product Admin which should give it all of the
nessasary parts to run as a web app. Instead it did this:
C:\ruby\depot>ruby script\generate scaffold Product
exists app/models/
exists app/controllers/
exists app/helpers/
create app/views/products
exists app/views/layouts/
exists test/functional/
exists test/unit/
create app/views/products/index.html.erb
wrong number of arguments (1 for 2)
command: ruby script/generate scaffold product admin
the above command creates controller as well as default view.
command: ruby script\generate scaffold Product code:integer name:string
In the above command, I don’t specify controller, so how will the
controller and views will be created?
The new version of Rails isn’t actually so different from what I can
see - although i’m still learning also, so I’m open to correction
there…
what the scaffold does now is to generate the view, controller, and
model all in one… it also generates a database migration file (in
the db folder) which can be edited before performing a rake db:migrate
to create the database table with relevant fields… it’s not really
too complex…
My assumption is that the original poster is trying to follow the Agile
Web
Development with Rails book which is not compatible with Rails 2.0
My suggestion is to uninstall Rails
gem uninstall rails
then reinstall the specific version that will work with that book
gem install version=1.2.6 rails
Then, recreate the depot application
rails depot
That will allow you to complete the book, afterwhich you can upgrade to
Rails 2.0.
I trying to follow the AWDWR 2nd Edition book and I’ve seen your
suggestion in other place too. I can’t see the point though, what is the
point on learning an obsolete version of rails when the new one is
obviously so different! Does anybody know how to work around this
problem with Rails 2.x?
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.