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

softwareengineer 99 softwareengineer99 at yahoo.com
Sat Feb 4 18:46:50 GMT 2006


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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060204/db4acfd0/attachment-0001.html


More information about the Rails mailing list