Lea Viljanen
2007-Feb-20 13:30 UTC
[Masterview-users] "generate masterview model controller" produces 0 length HTML files
Why are the Masterview HTML templates empty after the following sequence: lea at migrox:~/src/swaram/app$ cd .. lea at migrox:~/src/swaram$ script/generate masterview license admin Initializing MasterView configuration (2007-02-20 15:09) Program name = script/generate dependency model exists app/models/ exists test/unit/ exists test/fixtures/ skip app/models/license.rb skip test/unit/license_test.rb skip test/fixtures/licenses.yml exists app/controllers/ exists app/helpers/ exists app/views/admin exists public/stylesheets/masterview exists app/masterview exists app/masterview/extra exists test/functional/ overwrite app/controllers/admin_controller.rb? [Ynaqd] n skip app/controllers/admin_controller.rb overwrite test/functional/admin_controller_test.rb? [Ynaqd] n skip test/functional/admin_controller_test.rb identical app/helpers/admin_helper.rb create admin/list.html create admin/destroy.html create admin/show.html create admin/new.html create admin/edit.html identical public/stylesheets/masterview/style.css overwrite public/stylesheets/masterview/sidebox.css? [Ynaqd] n skip public/stylesheets/masterview/sidebox.css overwrite public/stylesheets/masterview/color-scheme.css? [Ynaqd] n skip public/stylesheets/masterview/color-scheme.css identical app/masterview/extra/mvpreview.js identical app/masterview/extra/show_only_new.css identical app/masterview/extra/show_only_edit.css identical app/masterview/extra/show_only_show.css identical app/masterview/extra/show_only_list.css identical app/masterview/extra/show_only_destroy.css lea at migrox:~/src/swaram$ lea at migrox:~/src/swaram$ cd app/views/admin/ lea at migrox:~/src/swaram/app/views/admin$ ls -al total 120 drwxr-xr-x 4 lea lea 4096 2007-02-20 15:09 . drwxr-xr-x 12 lea lea 4096 2007-02-17 00:13 .. -rw-r--r-- 1 lea lea 0 2007-02-20 15:09 destroy.html -rw-r--r-- 1 lea lea 0 2007-02-20 15:09 edit.html ... To recap, I am in the process of converting an existing application to use Masterview, so I actually do have a model called license and a controller called admin. And no, I''m not willing to totally overwrite them, just generate the HTML, thank you. With the previous two controllers I converted, I just copied the existing HTML files using the Admin GUI without using the generator, so I haven''t had this particular problem before. Or is it intended that the generator is used only when running MV for the first time and then everything is copied through the admin web? If so, a hint towards this in the documentation would be nice. -- Lea ''LadyBug'' Viljanen Independent security consultant. ladybug at iki.fi http://www.lavsecurity.fi/
Jeff Barczewski
2007-Feb-20 16:26 UTC
[Masterview-users] "generate masterview model controller" produces 0 length HTML files
On 2/20/07, Lea Viljanen <Lea.Viljanen at iki.fi> wrote:> > Why are the Masterview HTML templates empty after the following sequence: > > lea at migrox:~/src/swaram/app$ cd .. > lea at migrox:~/src/swaram$ script/generate masterview license admin > Initializing MasterView configuration (2007-02-20 15:09) > Program name = script/generate > dependency model > exists app/models/ > exists test/unit/ > exists test/fixtures/ > skip app/models/license.rb > skip test/unit/license_test.rb > skip test/fixtures/licenses.yml > exists app/controllers/ > exists app/helpers/ > exists app/views/admin > exists public/stylesheets/masterview > exists app/masterview > exists app/masterview/extra > exists test/functional/ > overwrite app/controllers/admin_controller.rb? [Ynaqd] n > skip app/controllers/admin_controller.rb > overwrite test/functional/admin_controller_test.rb? [Ynaqd] n > skip test/functional/admin_controller_test.rb > identical app/helpers/admin_helper.rb > create admin/list.html > create admin/destroy.html > create admin/show.html > create admin/new.html > create admin/edit.html > identical public/stylesheets/masterview/style.css > overwrite public/stylesheets/masterview/sidebox.css? [Ynaqd] n > skip public/stylesheets/masterview/sidebox.css > overwrite public/stylesheets/masterview/color-scheme.css? [Ynaqd] n > skip public/stylesheets/masterview/color-scheme.css > identical app/masterview/extra/mvpreview.js > identical app/masterview/extra/show_only_new.css > identical app/masterview/extra/show_only_edit.css > identical app/masterview/extra/show_only_show.css > identical app/masterview/extra/show_only_list.css > identical app/masterview/extra/show_only_destroy.css > lea at migrox:~/src/swaram$ > lea at migrox:~/src/swaram$ cd app/views/admin/ > lea at migrox:~/src/swaram/app/views/admin$ ls -al > total 120 > drwxr-xr-x 4 lea lea 4096 2007-02-20 15:09 . > drwxr-xr-x 12 lea lea 4096 2007-02-17 00:13 .. > -rw-r--r-- 1 lea lea 0 2007-02-20 15:09 destroy.html > -rw-r--r-- 1 lea lea 0 2007-02-20 15:09 edit.html > ... > > To recap, I am in the process of converting an existing application to > use Masterview, so I actually do have a model called license and a > controller called admin. And no, I''m not willing to totally overwrite > them, just generate the HTML, thank you. > > With the previous two controllers I converted, I just copied the > existing HTML files using the Admin GUI without using the generator, so > I haven''t had this particular problem before. Or is it intended that the > generator is used only when running MV for the first time and then > everything is copied through the admin web? If so, a hint towards this > in the documentation would be nice. > > -- > Lea ''LadyBug'' Viljanen Independent security consultant. > ladybug at iki.fi http://www.lavsecurity.fi/ > >Lea, The generator is designed to get a person up and running as quickly as possible with a CRUD application in MasterView. It can be run with an existing project or a new project. However like you said, if you already have a working controller and model, then you will probably want to tell the generator to not override those files. You will want to make sure that your controller method names match up with the templates being generated (both name wise and that the appropriate instance variables are being created for the views to use). Another thing you could do to help this process is to create another rails app and generate it there to see what the controller it creates looks like and you can then update yours appropriately. Alternatively you can update the views. The generator isn''t the only way to proceed, though it is one of the quickest. The other option is to simply take some html representing what you want to end up with and then sprinkly the MasterView directives into it, to make it real. We are planning to prepare more info and videos about how to do this second process. I hope this helps some. If you have trouble we''ll try to help however we can. Blessings, Jeff -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/masterview-users/attachments/20070220/10fbe6a1/attachment.html