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 <mailing@gp-net.nl> 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/<whatever> 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 eitherThe 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!
Yep, That''s in my config/evironment.rb. To zoom in on the earlier posted part. The piece below seems NOT to pick the controllers and accompanying layouts and action properly. I get errors like unknown method, and see a double controller name. When I want to redirect on logout to ''crm/main'' is see ''crm/crm/main'' and it should be crm/main. Which then results in changing the code in the plugin dir. And then I''m back at the beginning of the circle. make a copy or edit the user_conroller.rb in the plugin dir? Thanx btw for investing your time. Regards, Gerard.> The funny thing is that I''ve got this in several views/layout files: > > <% if @session[:user] %> > Logged in as "<b><%= @session[:user].login %></b>" | <%= link_to > ''logout'', :action => ''logout'' %> > <% else %> > not logged in | <%= link_to ''login'', :controller => ''/user'', :action => > ''login'' %> > <% end %> > > But they still don''t work globally as wel as they should. You''re saying Ineed> to remove the user_controller.rb and edit the one in the plugin dir?On Thursday 05 January 2006 10:39, James Adam tried to type something like:> Engines.start-- "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!