I would like to embed my login form on my app''s home page. What''s the best way to render the login action of member controller from another action? Thanks Frank --------------------------------- Relax. Yahoo! Mail virus scanning helps detect nasty viruses! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060204/3fd370db/attachment.html
On Feb 4, 2006, at 19:24, softwareengineer 99 wrote:> I would like to embed my login form on my app''s home page. What''s > the best way to render the login action of member controller from > another action?If there''s a controller that renders that form, a clean idiom is to embed it calling render_component from the view: http://api.rubyonrails.com/classes/ActionController/Components.html -- fxn
Thanks Xavier for your quick assistance. The problem is that when I use render_component :controller => "member", :action => "login" the original home page doesn''t render anymore. I tried the following after rendering the above component, but then my application stops. I am guessing it goes into an infinite loop. render_component :controller => "home", :action => "show", :params => { "category" => @params[:category] } How can I render my home page, but just add the form there? Thanks Frank Xavier Noria <fxn@hashref.com> wrote: On Feb 4, 2006, at 19:24, softwareengineer 99 wrote:> I would like to embed my login form on my app''s home page. What''s > the best way to render the login action of member controller from > another action?If there''s a controller that renders that form, a clean idiom is to embed it calling render_component from the view: http://api.rubyonrails.com/classes/ActionController/Components.html -- fxn _______________________________________________ Rails mailing list Rails@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails --------------------------------- Relax. Yahoo! Mail virus scanning helps detect nasty viruses! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060204/ba541320/attachment.html
Xavier, I figured it out. I was trying to put it in the controller, but if I put it in views directory, it works Thanks for your assistance. Frank softwareengineer 99 <softwareengineer99@yahoo.com> wrote: Thanks Xavier for your quick assistance. The problem is that when I use render_component :controller => "member", :action => "login" the original home page doesn''t render anymore. I tried the following after rendering the above component, but then my application stops. I am guessing it goes into an infinite loop. render_component :controller => "home", :action => "show", :params => { "category" => @params[:category] } How can I render my home page, but just add the form there? Thanks Frank Xavier Noria <fxn@hashref.com> wrote: On Feb 4, 2006, at 19:24, softwareengineer 99 wrote:> I would like to embed my login form on my app''s home page. What''s > the best way to render the login action of member controller f rom > another action?If there''s a controller that renders that form, a clean idiom is to embed it calling render_component from the view: http://api.rubyonrails.com/classes/ActionController/Components.html -- fxn _______________________________________________ Rails mailing list Rails@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails --------------------------------- Relax. Yahoo! Mail virus scanning helps detect nasty viruses!_______________________________________________ Rails mailing list Rails@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails --------------------------------- Yahoo! Mail - Helps protect you from nasty viruses. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060204/db4acfd0/attachment-0001.html
softwareengineer 99
2006-Feb-04 18:51 UTC
[Rails] What''s the best way to embed a form?: Header showing multiple times?
Now I am having an issue where my layout is rendered twice? My header is showing two times, once for the home page and the second time for the login page. Is there a way that I can have the layout rendered only once? Thanks Frank softwareengineer 99 <softwareengineer99@yahoo.com> wrote: Xavier, I figured it out. I was trying to put it in the controller, but if I put it in views directory, it works Thanks for your assistance. Frank softwareengineer 99 <softwareengineer99@yahoo.com> wrote: Thanks Xavier for your quick assistance. The problem is that when I use render_component :controller => "member", :action => "login" the original home page doesn''t render anymore. I tried the following after rendering the above component, but then my application stops. I am guessing it goes into an infinite loop. render_component :controller => "home", :action => "show", :params => { "category" => @params[:category] } How can I render my home page, but just add the form there? Thanks Frank Xavier Noria <fxn@hashref.com> wrote: On Feb 4, 2006, at 19:24, softwareengineer 99 wrote:> I would like to embed my login form on my app''s home page. What''s > the best way to render the login action of member controller f rom > another action?If there''s a controller that renders that form, a clean idiom is to embed it calling render_component from the view: http://api.rubyonrails.com/classes/ActionController/Components.html -- fxn _______________________________________________ Rails mailing list Rails@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails --------------------------------- Relax. Yahoo! Mail virus scanning helps detect nasty viruses!_______________________________________________ Rails mailing list Rails@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails --------------------------------- Yahoo! Mail - Helps protect you from nasty viruses._______________________________________________ Rails mailing list Rails@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails --------------------------------- Brings words and photos together (easily) with PhotoMail - it''s free and works with Yahoo! Mail. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060204/bae7a542/attachment.html
On Feb 4, 2006, at 10:24 AM, softwareengineer 99 wrote:> I would like to embed my login form on my app''s home page. What''s > the best way to render the login action of member controller from > another action?Unless your users are forced to view the home page via SSL, what you are trying to do (and is done so commonly) is not secure: http://blogs.msdn.com/ie/archive/2005/04/20/410240.aspx -- -- Tom Mornini
I am using SSL for the entire app so security is not an issue here. Thanks Frank Tom Mornini <tmornini@infomania.com> wrote: On Feb 4, 2006, at 10:24 AM, softwareengineer 99 wrote:> I would like to embed my login form on my app''s home page. What''s > the best way to render the login action of member controller from > another action?Unless your users are forced to view the home page via SSL, what you are trying to do (and is done so commonly) is not secure: http://blogs.msdn.com/ie/archive/2005/04/20/410240.aspx -- -- Tom Mornini _______________________________________________ Rails mailing list Rails@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails --------------------------------- Relax. Yahoo! Mail virus scanning helps detect nasty viruses! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060204/ac9a65f7/attachment.html
Xavier Noria
2006-Feb-04 19:50 UTC
[Rails] What''s the best way to embed a form?: Header showing multiple times?
On Feb 4, 2006, at 19:51, softwareengineer 99 wrote:> Now I am having an issue where my layout is rendered twice? My > header is showing two times, once for the home page and the second > time for the login page. > > Is there a way that I can have the layout rendered only once?Yes, in your application the generation of the login form does not construct an entire HTML page, it only creates a HTML form. In those situations you need to render :layout => false. -- fxn
softwareengineer 99
2006-Feb-04 20:33 UTC
[Rails] What''s the best way to embed a form?: Header showing multiple times?
Thank you so much for your reply. Unfortunately, I can''t get it to work. According to http://rails.techno-weenie.net/question/2006/1/14/render_component_infinite_loop , its the render method that supports :layout=>false. When I place :layout=>false in render_component, nothing happens. When I palce render (:layout=>false ) at the end of my function, no form is shown. When I change render_component to render, still no form shows up. So far: in show.rhtml, I have <%= render :controller => "member", :action => "login", :layout => false, :params => { "member[login]" => "" } %> When I put render (:layout=>false) in my tags_controller, the layout is shown 0 times. I tried <%= render_component :controller => "member", :action => "login", :layout => false, :params => { "member[login]" => "" } %> but it causes the layout to show two times. I am really confused at the moment and appreciate any help. Thanks Frank Xavier Noria <fxn@hashref.com> wrote: On Feb 4, 2006, at 19:51, softwareengineer 99 wrote:> Now I am having an issue where my layout is rendered twice? My > header is showing two times, once for the home page and the second > time for the login page. > > Is there a way that I can have the layout rendered only once?Yes, in your application the generation of the login form does not construct an entire HTML page, it only creates a HTML form. In those situations you need to render :layout => false. -- fxn _______________________________________________ Rails mailing list Rails@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails --------------------------------- Yahoo! Mail - Helps protect you from nasty viruses. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060204/a721da5e/attachment-0001.html
Xavier Noria
2006-Feb-04 21:29 UTC
[Rails] What''s the best way to embed a form?: Header showing multiple times?
On Feb 4, 2006, at 21:33, softwareengineer 99 wrote:> Thank you so much for your reply. > > Unfortunately, I can''t get it to work.The idea is: 1. In the view that generates the home you put something like this: <%= render_component :controller => "member", :action => "login_form" %> 2. In member_controller.rb there''s the corresponding action whose only purpose is the generation of the login form: def login_form # ... render :layout => false end 3. The file login_form.rhtml generates a HTML form that calls the actual "login" action if submitted. This is a technique to include HTML from other controllers, it makes sense when the generated HTML needs to be included in several places, when the controller is needed to take some logic into account in the generation of the HTML, etc. If the controller is not needed then factoring out the very form in a private template plus render :partial in the view is another standard idiom. -- fxn
softwareengineer 99
2006-Feb-04 22:26 UTC
[Rails] What''s the best way to embed a form?: Header showing multiple times?
Xavier, Thank you once again for your detailed reply. I created a method named ''login_form'' and the corresponding .rhtml file. but now I just keep getting the following error: "::MemberController" is not a valid constant name! I thought one could add a new action by simply creating the method and the .rhtml file. What am I missing? Any pointers are greatly appreciated. Thanks Frank --------------------------------- Brings words and photos together (easily) with PhotoMail - it''s free and works with Yahoo! Mail. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060204/195a9cb1/attachment.html
softwareengineer 99
2006-Feb-04 22:36 UTC
[Rails] What''s the best way to embed a form?: Header showing multiple times?
I just wanted to add to the following post that the moment I change <%= render_component :controller => "member", :action => "login_form"%> to <%= render_component :controller => "member", :action => "login"%> I don''t get the exception error. Can anyone please guide me as to what else is required to create an action? I have created the .rhtml file and defined the method in my controller? Thanks softwareengineer 99 <softwareengineer99@yahoo.com> wrote: Xavier, Thank you once again for your detailed reply. I created a method named ''login_form'' and the corresponding .rhtml file. but now I just keep getting the following error: "::MemberController" is not a valid constant name! I thought one could add a new action by simply creating the method and the .rhtml file. What am I missing? Any pointers are greatly appreciated. Thanks Frank --------------------------------- Brings words and photos together (easily) with PhotoMail - it''s free and works with Yahoo! Mail._______________________________________________ Rails mailing list Rails@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails --------------------------------- Brings words and photos together (easily) with PhotoMail - it''s free and works with Yahoo! Mail. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060204/9fa28305/attachment.html
Xavier Noria
2006-Feb-04 22:40 UTC
[Rails] What''s the best way to embed a form?: Header showing multiple times?
On Feb 4, 2006, at 23:26, softwareengineer 99 wrote:> Thank you once again for your detailed reply.Sure.> I created a method named ''login_form'' and the corresponding .rhtml > file. but now I just keep getting the following error: > > "::MemberController" is not a valid constant name! > > I thought one could add a new action by simply creating the method > and the .rhtml file. > > What am I missing?Can you send the smallest relevant code snippets? -- fxn
softwareengineer 99
2006-Feb-04 22:53 UTC
[Rails] What''s the best way to embed a form?: Header showing multiple times?
Thank you Xavier for your reply: Here is the views/member/login_form.rhtml (edited for html) <%= head_helper %> <%= start_form_tag_helper %> <%= form_input :text_field, "login", :size => 30 %><br/> <%= form_input :password_field, "password", :size => 30 %><br/> <%= button_helper ''login'' %> <%= link_helper ''login_signup'', :action => ''signup'' %> | <%= link_helper ''login_forgot_password'', :action => ''forgot_password'' %> <%= end_form_tag %> The following is the line in views/tags/show.html <%= render_component :controller => "member", :action => "login_form"%> If I change the above line back to login, I don''t get the exception error. Here are the lines from member_controller.rb 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 Unfortunately, since I ported my app to use SVN, I don''t have access to log contents either (an issue I am working on fixing). If there is anything else that you would like to see, please let me know. Once again, thank you very much for your assistance. Frank > What am I missing? Can you send the smallest relevant code snippets? -- fxn _______________________________________________ Rails mailing list Rails@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails --------------------------------- Brings words and photos together (easily) with PhotoMail - it''s free and works with Yahoo! Mail. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060204/9b0c606e/attachment.html
softwareengineer 99
2006-Feb-04 22:57 UTC
[Rails] What''s the best way to embed a form?: Header showing multiple times?
I was able to get access to logs using the webrick server and the following is an excerpt: Processing MemberController#login_form (for 151.213.150.183 at 2006-02-04 15:50:05) [GET] Parameters: {"action"=>"login_form", "id"=>nil, "controller"=>"member"} Redirected to http://accounting.adoppt.com:3000/member/login Filter chain halted as [login_required] returned false Completed in 0.00104 (961 reqs/sec) | DB: 0.00000 (0%) | 302 Found [http://accounting.adoppt.com/tag/business] Start rendering component ({:controller=>"/member", :action=>"login"}): ActionView::TemplateError ("::MemberController" is not a valid constant name!) on line #9 of app/views/tags/show.rhtml: 6: 7: 8: 9: <%= render_component :controller => "member", :action => "login_form"%> 10: 11: <table class="main" align="center"> 12: I appreciate your assistance. Thanks Frank softwareengineer 99 <softwareengineer99@yahoo.com> wrote: Thank you Xavier for your reply: Here is the views/member/login_form.rhtml (edited for html) <%= head_helper %> <%= start_form_tag_helper %> <%= form_input :text_field, "login", :size => 30 %><br/> <%= form_input :password_field, "password", :size => 30 %><br/> <%= button_helper ''login'' %> <%= link_helper ''login_signup'', :action => ''signup'' %> | <%= link_helper ''login_forgot_password'', :action => ''forgot_password'' %> <%= end_form_tag %> The following is the line in views/tags/show.html <%= render_component :contro ller => "member", :action => "login_form"%> If I change the above line back to login, I don''t get the exception error. Here are the lines from member_controller.rb 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 Unfortunately, since I ported my app to use SVN, I don''t have acce ss to log contents either (an issue I am working on fixing). If there is anything else that you would like to see, please let me know. Once again, thank you very much for your assistance. Frank > What am I missing? Can you send the smallest relevant code snippets? -- fxn _______________________________________________ Rails mailing list Rails@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails --------------------------------- Brings words and photos together (easily) with PhotoMail - it''s free and works with Yahoo! Mail._______________________________________________ Rails mailing list Rails@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails --------------------------------- Relax. Yahoo! Mail virus scanning helps detect nasty viruses! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060204/4d2dfd30/attachment.html
Xavier Noria
2006-Feb-05 09:02 UTC
[Rails] What''s the best way to embed a form?: Header showing multiple times?
On Feb 4, 2006, at 23:53, softwareengineer 99 wrote:> Thank you Xavier for your reply: > > Here is the views/member/login_form.rhtml (edited for html) > <%= head_helper %> > <%= start_form_tag_helper %> > <%= form_input :text_field, "login", :size => 30 %><br/> > <%= form_input :password_field, "password", :size => 30 % > ><br/> > <%= button_helper ''login'' %> > <%= link_helper ''login_signup'', :action => ''signup'' %> | > <%= link_helper ''login_forgot_password'', :action => > ''forgot_password'' %> > <%= end_form_tag %> > > The following is the line in views/tags/show.html > > <%= render_component :contro ller => "member", :action => > "login_form"%>There''s a spurious space in ":contro ller".
softwareengineer 99
2006-Feb-05 17:45 UTC
[Rails] What''s the best way to embed a form?: Header showing multiple times?
I can''t say thanks enough for you continung to assist me. I have no idea how the space got in the message. I checked with my code and there is no space or I edited it out earlier: <%= render_component :controller => "member", :action => "login_form"%> I spent all night trying to figure it out but to no avail. Am I right in assuming that a method and a corresponding .rhtml file is all that''s needed to create an action? Frank Xavier Noria <fxn@hashref.com> wrote: On Feb 4, 2006, at 23:53, softwareengineer 99 wrote:> Thank you Xavier for your reply: > > Here is the views/member/login_form.rhtml (edited for html) > <%= head_helper %> > <%= start_form_tag_helper %> > <%= form_input :text_field, "login", :size => 30 %>> <%= form_input :password_field, "password", :size => 30 % > >> <%= button_helper ''login'' %> > <%= link_helper ''login_signup'', :action => ''signup'' %> | > <%= link_helper ''login_forgot_password'', :action => > ''forgot_password'' %> > <%= end_form_tag %> > > The following is the line in views/tags/show.html > > <%= render_component :contro ller => "member", :action => > "login_form"%>There''s a spurious space in ":contro ller". _______________________________________________ Rails mailing list Rails@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails --------------------------------- Brings words and photos together (easily) with PhotoMail - it''s free and works with Yahoo! Mail. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060205/e928544d/attachment.html
softwareengineer 99
2006-Feb-05 18:17 UTC
[Rails] What''s the best way to embed a form?: Header showing multiple times?
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 Noria <fxn@hashref.com> 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. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060205/55589916/attachment.html
Byron Saltysiak
2006-Feb-05 18:23 UTC
[Rails] What''s the best way to embed a form?: Header showing multiple times?
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 <softwareengineer99@yahoo.com> 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 Noria <fxn@hashref.com>* wrote: > > On Feb 4, 2006, at 23:53, softwareengineer 99 wrote: > > > Thank you Xavier for your reply: > > > ------------------------------ > Yahoo! Mail<http://us.rd.yahoo.com/mail_us/taglines/virusmail/*http://mail.yahoo.com>- Helps protect you from nasty viruses. > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >-- Byron http://byron.saltysiak.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060205/03c32828/attachment-0001.html
softwareengineer 99
2006-Feb-05 19:20 UTC
[Rails] What''s the best way to embed a form?: Header showing multiple times?
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 Saltysiak <byronsalty@gmail.com> 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 <softwareengineer99@yahoo.com > 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 Noria <fxn@hashref.com> 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 Rails@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails -- Byron http://byron.saltysiak.com _______________________________________________ Rails mailing list Rails@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails --------------------------------- Brings words and photos together (easily) with PhotoMail - it''s free and works with Yahoo! Mail. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060205/0220dc00/attachment-0001.html
softwareengineer 99
2006-Feb-06 02:28 UTC
[Rails] What''s the best way to embed a form?: Header showing multiple times?
Thanks Byron for your reply. Frank Byron Saltysiak <byronsalty@gmail.com> 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 ] --------------------------------- Brings words and photos together (easily) with PhotoMail - it''s free and works with Yahoo! Mail. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060206/8e966738/attachment.html
I''ve got an RXML file in the view for a model and an empty reference to the desired view in my controller. While I am producing the XML I want, I am also generating an HTML header that contains: <html> <head> <title>. <link>. </head> </body> <p style. I was under the impression that just by naming the file .rxml and then putting XML-generating instructions in the file, I should get pure XML but apparently I was mistaken. How do I ditch this unwanted addition/header to my result? Thanks, -Mark -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060208/e7122b56/attachment.html
Are you perhaps getting a layout in there too? Just a wild stab in the dark.... b Mark Wales wrote:> I?ve got an RXML file in the view for a model and an empty reference to > the desired view in my controller. While I am producing the XML I want, > I am also generating an HTML header that contains: > > > > <html> > > <head> > > <title>? > > <link>? > > </head> > > </body> > > > > <p style? > > > > I was under the impression that just by naming the file .rxml and then > putting XML-generating instructions in the file, I should get pure XML > but apparently I was mistaken? > > > > How do I ditch this unwanted addition/header to my result? > > > > Thanks, > > > > -Mark > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails