rbac_bootstrap generator problem

0 views
Skip to first unread message

Feurio

unread,
Oct 11, 2007, 12:40:27 PM10/11/07
to active-rbac
Hello folks,

I do have a hard time with the rbac_bootstrap generator.

I have active-rbac 0.5, rails 1.2.4.(I also tried 1.2.3) and ruby
1.8.6.

This command 'ruby script/generate rbac_bootstrap Test' produces this
error message:
----------
exists app/controllers
exists app/models
exists app/views/auth
exists test/unit
exists test/functional
identical app/controllers/auth_controller.rb
undefined method `error_messages_for' for
#<Rails::Generator::Commands::Create:0x3356594>
----------

It seems somehow to be related to erb because if I comment this out in
rbac_bootstrap_generator.rb

m.template "#{str}.rhtml", "app/views/auth/#{str}.rhtml"

everything works. But of course the rhtml-template files are not
created.

Any ideas what the problem could be?

Feurio

iggy

unread,
Nov 11, 2007, 12:16:37 AM11/11/07
to active-rbac
Bit of a late reply, but here's a guess: the generator script tries to
interpret the <% %> tagged functions in login.rhtml and logout.rhtml,
which is not at all what we want to have happen (the functions in
those tags should be interpreted when the view is accessed, not by the
generator script). The solution seems to be to to add tags around the
offending lines in the files, i.e. replace <%= error_messages_for
'user' %> with <%%= error_messages_for 'user' %>. More lines in those
files might need to be changed. I haven't had time to test it myself.
Look at the end of this wiki page for a similar problem:
http://wiki.rubyonrails.org/rails/pages/TabbedNavbarGenerator.

Iggy

Greg Furmanek

unread,
Nov 20, 2007, 12:23:10 AM11/20/07
to active-rbac
Wouldn't be much easier to just copy the files?
Is there something that needs to be interpreted in these rhtml
templates during generation?

Greg Furmanek

unread,
Nov 20, 2007, 9:06:00 PM11/20/07
to active-rbac
If the intent is to just copy the file then you can change the
m.template => m.file

BTW. When I run the bootstrap with
./scripts/generate rbac_bootstrap it complains with:
Usage: script/generate rbac_bootstrap RbacBootstrapName [options]

What is RbacBootstrapName?

Manuel Holtgrewe

unread,
Nov 30, 2007, 5:06:50 PM11/30/07
to active-rbac


On Nov 21, 3:06 am, Greg Furmanek <greg.furma...@gmail.com> wrote:
> If the intent is to just copy the file then you can change the
> m.template => m.file

I just did the change. Update to current trunk to see the changes.

> BTW. When I run the bootstrap with
> ./scripts/generate rbac_bootstrap it complains with:
> Usage: script/generate rbac_bootstrap RbacBootstrapName [options]
>
> What is RbacBootstrapName?

I inherited from Generator::NamedBase instead of Generator::Base. I
changed this to Generator::Base so you do not have to enter this any
more.

Bests,

Manuel
Reply all
Reply to author
Forward
0 new messages