[Rails] What's the best way to embed a form?

softwareengineer 99 softwareengineer99 at yahoo.com
Sat Feb 4 18:44:16 GMT 2006


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


More information about the Rails mailing list