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

softwareengineer 99 softwareengineer99 at yahoo.com
Sat Feb 4 20:33:45 GMT 2006


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 at 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 at 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


More information about the Rails mailing list