Byron,
Thank you for your reply.
That did the trick.
Big thanks to Xavier also for spending a great deal of his weekend on
assisting me.
ROR is the future.
Frank
Byron S. [email protected] wrote: You can change the
rendering of layouts in a more declarative way at the top of controllers
with something like:
layout “application”, :except => [ :login_form ]
On 2/5/06, softwareengineer 99 <[email protected] >
wrote:After some digging around, I found the solution to the error:
“::MemberController” is not a valid constant name!
The error goes away if I comment out the following line in
member_controller.rb
before_filter :login_required
My MemberController has the following layout applied to it
class MemberController < ApplicationController
layout ‘default-layout’
This is causing the header to show up two times (even for my new
method login_form).
How can I have a default layout applied to a Controller and then turn
it off for one function?
Currently my tags/show.rhtml reads
<%= render_component :controller => “member”, :action =>
“login_form”%>
And my login_form definition in member_controller is:
def login_form
return if generate_blank
@member = Member.new(@params[‘member’])
if @session[‘member’] =
Member.authenticate(@params[‘member’][‘login’],
@params[‘member’][‘password’])
flash[‘notice’] = l(:member_login_succeeded)
redirect_back_or_default :action => ‘welcome’
else
@login = @params[‘member’][‘login’]
flash.now[‘message’] = l(:member_login_failed)
end
render :layout => false
end
Why isn’t the render :layout => false working here?
I thought it would be nice to have the layout applied to the entire
controller. But I didn’t know that tunring it off will become such a
hassle?
So what are the best practices in this case? Is it good to apply a
“global” layout and then turn it off for each function (which isn’t
working for me) or not have a “global” layout and then apply it for
each method?
Needless to say, I am so confused with layouts here.
Your continued assistance is highly appreciated. I am sure this will
help a lot of new learners here too.
Frank
Xavier N. [email protected] wrote: On Feb 4, 2006, at 23:53,
softwareengineer 99 wrote:
Thank you Xavier for your reply:
Yahoo! Mail - Helps protect you from nasty viruses.
Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails
–
Byron
http://byron.saltysiak.com
Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails