[Rails] What's the best way to embed a form?: Header showing multiple times?

softwareengineer 99 softwareengineer99 at yahoo.com
Sat Feb 4 18:51:24 GMT 2006


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 at 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 at 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 at 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 at lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails

    

---------------------------------
Relax. Yahoo! Mail      virus   scanning helps detect nasty viruses!_______________________________________________
Rails mailing list
Rails at lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails

       

---------------------------------
 Yahoo! Mail - Helps protect you from nasty viruses._______________________________________________
Rails mailing list
Rails at 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


More information about the Rails mailing list