I''m using LoginEngine + UserEngine for web application. 1. I have some controllers under and admin subdirectory (Admin::PostController etc). The auto-fill permission in UserEngine does not work correctly with those controllers. Right at the moment this is not a problem, since I kind like having the Admin section separated and available only for god users. However, I could use Something::Controller somewhere else, and I would like to know how it deals with these. 2. I need to redefine the views included in the engines. Is it sufficient to create an /app/views/user directory and put the new rhtml files there? Has it got any drawbacks? 3. How can I "hide" a controller without accessing its source code? That is to say I do not want people to mess with the RoleController and PermissionController. I kind of need to make them not accessible. Their functionality will be available from Admin::RoleController < RoleController, or something like this. I do not want to edit their code, since when my hosting upgrades to Rails 1.1 I may want to upgrade the engines too, and since it is something I know will happen, I would like not to have to mess with svn diffs if I can avoid it :) Tanks in advance -- blog: http://www.akropolix.net/rik0/blogs | site: http://www.akropolix.net/rik0/ | forum: http://www.akropolix.net/forum/ |
Riko <rik0.py@gmail.com> writes:> I''m using LoginEngine + UserEngine for web application. > > 1. I have some controllers under and admin subdirectory > (Admin::PostController etc). The auto-fill permission in UserEngine > does not work correctly with those controllers. > > Right at the moment this is not a problem, since I kind like having > the Admin section separated and available only for god users. However, > I could use Something::Controller somewhere else, and I would like to > know how it deals with these. > > 2. I need to redefine the views included in the engines. Is it > sufficient to create an /app/views/user directory and put the new > rhtml files there? Has it got any drawbacks?Thats the way to do it. You can also override some of the controller actions.> > 3. How can I "hide" a controller without accessing its source code? > That is to say I do not want people to mess with the RoleController > and PermissionController. I kind of need to make them not accessible. > > Their functionality will be available from Admin::RoleController < > RoleController, or something like this. > > I do not want to edit their code, since when my hosting upgrades to > Rails 1.1 I may want to upgrade the engines too, and since it is > something I know will happen, I would like not to have to mess with > svn diffs if I can avoid it :) >With the `authenticate''(check the docs to confirm name) filter the actions can be hidden from the guest, and the user roles. Besides you can also redefine the actions (the old definitions get overridden). I will suggest reading the engines wiki, and the readmes, also engines mailing list will be a better place to ask such questions. HTH. -- Surendra Singhi http://ssinghi.kreeti.com, http://www.kreeti.com Read my blog at: http://cuttingtheredtape.blogspot.com/ ,---- | "War is Peace! Freedom is Slavery! Ignorance is Strength!" | -- Orwell, 1984, 1948 `----
Surendra Singhi wrote:> Thats the way to do it. You can also override some of the controller actions.Ok. Thank you very much.> With the `authenticate''(check the docs to confirm name) filter the actions can > be hidden from the guest, and the user roles.I know the guest can''t call it. I would have liked something like a "private" controller. But I suppose it''s the wrong way to do it.> Besides you can also redefine the actions (the old definitions get overridden).Yes, but I need them in the children. I think this gets messy for what I''ve to do.> I will suggest reading the engines wiki, and the readmes, also engines mailing > list will be a better place to ask such questions.Didn''t even know it existed. Thank you very much. -- blog: http://www.akropolix.net/rik0/blogs | site: http://www.akropolix.net/rik0/ | forum: http://www.akropolix.net/forum/ |
Every time I use the follow_redirect() function within a controller test, I get the following error: "TypeError: can''t convert Symbol into String" Looking at the source for this method I see: 377: def follow_redirect 378: if @response.redirected_to[:controller] 379: raise "Can''t follow redirects outside of current controller (#{@response.redirected_to[:controller]})" 380: end 381: 382: get(@response.redirected_to.delete(:action), @response.redirected_to.stringify_keys) 383: end I''m not really familiar with the internals of rails, but the following seems wrong: "get(@response.redirected_to.delete(:action)" "@response.redirected_to()" will return a String object....it appears that returning a Hash was the intended behavior thus the appending of delete(:action) and stringify_keys(). Is this bug or am I missing something? Kind Regards, -Steven Hansen