petak, 19. kolovoza 2011.

Ruby on Rails 3, scaffold_controller not works, solution with Niftygenerators

As I tried to use scaffold_controller on Ruby On Rails 3, to create controller and view, and generated code was not working, I tried niftygenerators and they work.
This is how you can use them:
Edit you Gemfile (in root of your project) and add

gem "nifty-generators", :group => :development

after that, you can run
bundle install
to install gem

After that, you can do
rails g nifty:scaffold ModelName
and after that we must create layout:
rails g nifty:layout
That will successfully create controller and view from your ActiveRecord.

Nema komentara:

Objavi komentar