Engine and controller layout confusion

Hi all,

Installed the login_engine which is working. But I’m confused as to how
I tell
Rails to use the “/app/views/layout” rhtml files, when partials from the
login_engine are used from
“/vendor/plugins/login_engine/app/views/user”.

Do I copy login.rhtml to /app/view/mgmt?
(mgmt is a controller name in my app)

Along the same line:

I also have a nil error on the line below:
if session[:user] = User.authenticate(params[:user][:login],
params[:user]
[:password])

Which seems correct (isn’t it?) because it’s in application.rb and the
login_engine use a model called user seemingly unknown in the
ApplicationController?

Can somebody tell me how to stick to Rails protocol on this?

Big thanx!

Grtz Gerard.


“Who cares if it doesn’t do anything? It was made with our new
Triple-Iso-Bifurcated-Krypton-Gate-MOS process …”

My $Grtz =~ Gerard;
~
:wq!

On 1/3/06, Gerard [email protected] wrote:

Installed the login_engine which is working. But I’m confused as to how I tell
Rails to use the “/app/views/layout” rhtml files, when partials from the
login_engine are used from “/vendor/plugins/login_engine/app/views/user”.

Rails will use any views in your /app/views/ subfolders in
precidence over anything in the login engine.

Do I copy login.rhtml to /app/view/mgmt?
(mgmt is a controller name in my app)

Umm… are you saying that you want to use your ‘mgmt’ controller to
login? I’m not sure what you mean here, or rather what problem you are
trying to solve.

I also have a nil error on the line below:
if session[:user] = User.authenticate(params[:user][:login], params[:user]
[:password])

Which seems correct (isn’t it?) because it’s in application.rb and the
login_engine use a model called user seemingly unknown in the
ApplicationController?

Have you followed the installation instructions for the login engine?
If there is no ‘User’ model available, most likely you either

a) haven’t installed the Engines plugin
b) haven’t inserted a call to Engines.start at the bottom of your
environment.rb file
c) both of the above

  • james

James,

thanx for the response. Replies inline …

Do I copy login.rhtml to /app/view/mgmt?
(mgmt is a controller name in my app)

Umm… are you saying that you want to use your ‘mgmt’ controller to
login? I’m not sure what you mean here, or rather what problem you are
trying to solve.
login.rhtml didn’t have the css layout I wanted. I did a symlink to
another
file. (and copied the user model. See below)
-rw-r----- 1 aaaaaa aaaaa 1402 Jan 4 11:19 mgmt.rhtml
lrwxrwxrwx 1 aaaaaa aaaaa 10 Jan 4 11:05 user.rhtml -> mgmt.rhtml

Which seems correct (isn’t it?) because it’s in application.rb and the
login_engine use a model called user seemingly unknown in the
ApplicationController?

Have you followed the installation instructions for the login engine?
If there is no ‘User’ model available, most likely you either
The user model was there but hidden in vendor/plugin/login_engine
somewhere.

I copied this one to /app/controllers/user_controller.rb. This works
now,
however there’s one question. I couldn’t get it working properly without
copying the user_controller.rb from the plugin directory to the
app/controller directory. Now it does all work. But if a newer version
of the
plugin is downloaded i’ve got two version in my environment. (I must
admit
I’m happy the way it works now btw).

And should I try to figure out how to make it work in th
plugin/…controller
directory and download a new version. My changes are lost.

Any suggestions on what’s best practice in this case?

A very big thanx!

Regards,

Gerard.


“Who cares if it doesn’t do anything? It was made with our new
Triple-Iso-Bifurcated-Krypton-Gate-MOS process …”

My $Grtz =~ Gerard;
~
:wq!