# Problem with render\_component

**URL:** <https://www.ruby-forum.com/t/problem-with-render-component/116015>\
**Category:** Rails\
**Created:** [October 1, 2007, 5:10pm UTC](https://www.ruby-forum.com/t/problem-with-render-component/116015 "2007-10-01T17:10:24Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kiran\_P](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/51bf81/32.png) [@Kiran\_P](https://www.ruby-forum.com/u/Kiran_P)\
**Post date:** [October 1, 2007, 5:10pm UTC](https://www.ruby-forum.com/t/problem-with-render-component/116015/1 "2007-10-01T17:10:24Z")

</div>

Hi,  
Friends, I am working on ruby on rails,

1. I have created a login form

\<%=flash[:notice].to\_s%\> 

```
<legend>
  Please Log In
</legend>
<% form_tag do %>
<p>
  <label for="name">Name:</label><br/><br/><br/>
  <%= text_field_tag :name, params[:name]%>
</p>
<p>
  <label for="password">Password:</label><br/><br/>
  <%= password_field_tag :password, params[:password]%>
</p>
<p>
  <%= submit_tag "login"%>

</p>
<%end%>

```

\<%#= button\_to “Back”, :controller=\>:main, :action=\>:unreg\_disp\_data%\>

```
</fieldset>

```

1. Then rendered this form in view using render\_component but after  
rendering this way i was unable to get the passed arguments

3)If i am creating a link instead of render\_component e.g.

\<%= link\_to\_remote “Sign In”,{  
:update=\>“account”,:url =\> {:controller =\> :account,:action =\> :login}  
}-%\>

it works fine

Can anyone suggest a solution for this, I will be thankful for the same

Regards,  
Kiran P.

---

<div class="post-metadata">

**Author:** ![Kiran\_P](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/51bf81/32.png) [@Kiran\_P](https://www.ruby-forum.com/u/Kiran_P)\
**Post date:** [October 1, 2007, 5:18pm UTC](https://www.ruby-forum.com/t/problem-with-render-component/116015/2 "2007-10-01T17:18:36Z")

</div>

> 1. Then rendered this form in view using render\_component but after  
> rendering this way i was unable to get the passed arguments

Is there any particular reason you are using render\_component?  
render\_component is mostly dead (IIRC it’s because components are big  
and heavy, because they are actually separate controller instances  
under the hood (which is probably why accessing params from the  
‘other’ instance of ActionController doesn’t work)

Fred

---

<div class="post-metadata">

**Author:** ![Kiran\_P](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/51bf81/32.png) [@Kiran\_P](https://www.ruby-forum.com/u/Kiran_P)\
**Post date:** [October 2, 2007, 11:20am UTC](https://www.ruby-forum.com/t/problem-with-render-component/116015/3 "2007-10-02T11:20:45Z")

</div>

Frederick C. wrote:

> > 
> 
> Is there any particular reason you are using render\_component?  
> render\_component is mostly dead …why accessing params from the  
> ‘other’ instance of ActionController doesn’t work)
> 
> Fred

(Note: this problem is earlier posted by “Pedro C.” but there is  
no solution given.)  
Thanks for the help, But I think I require some solution for this  
problem,I have created a home page and for a/c management I have created  
some .rhtml files, at the home page I want to render the login  
form.Please give me some solution…

Kiran

---

<div class="post-metadata">

**Author:** ![Kiran\_P](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/51bf81/32.png) [@Kiran\_P](https://www.ruby-forum.com/u/Kiran_P)\
**Post date:** [October 2, 2007, 11:24am UTC](https://www.ruby-forum.com/t/problem-with-render-component/116015/4 "2007-10-02T11:24:41Z")

</div>

On 2 Oct 2007, at 10:20, Kiran P. wrote:

> (Note: this problem is earlier posted by “Pedro C.” but there is  
> no solution given.)  
> Thanks for the help, But I think I require some solution for this  
> problem,I have created a home page and for a/c management I have  
> created  
> some .rhtml files, at the home page I want to render the login  
> form.Please give me some solution…

components are dead. don’t use components. I’ve never used components  
(because of the former) and so I’m not well aquaintent with their  
intricacies. You probably could get something together using  
the :locals option of render, but like I said, components are dead.  
Use a partial.

Fred

---

<div class="post-metadata">

**Author:** ![Kiran\_P](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/51bf81/32.png) [@Kiran\_P](https://www.ruby-forum.com/u/Kiran_P)\
**Post date:** [October 2, 2007, 12:20pm UTC](https://www.ruby-forum.com/t/problem-with-render-component/116015/5 "2007-10-02T12:20:25Z")

</div>

Frederick C. wrote:

> On 2 Oct 2007, at 10:20, Kiran P. wrote:

> > 
> 
> components are dead. don’t use components. I’ve never used components  
> (because of the former) and so I’m not well aquaintent with their  
> intricacies. You probably could get something together using  
> the :locals option of render, but like I said, components are dead.  
> Use a partial.
> 
> Fred

Thank you very much… 🙂 it really works. I have used partials to do  
the same thing along with passing the arguments…

Kiran P.

---

<div class="post-metadata">

**Author:** ![Kiran\_P](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/51bf81/32.png) [@Kiran\_P](https://www.ruby-forum.com/u/Kiran_P)\
**Post date:** [October 2, 2007, 12:24pm UTC](https://www.ruby-forum.com/t/problem-with-render-component/116015/6 "2007-10-02T12:24:21Z")

</div>

Kiran P. wrote:

> Frederick C. wrote:
> 
> > On 2 Oct 2007, at 10:20, Kiran P. wrote:
> 
> > > 
> > 
> > components are dead. don’t use components. I’ve never used components  
> > (because of the former) and so I’m not well aquaintent with their  
> > intricacies. You probably could get something together using  
> > the :locals option of render, but like I said, components are dead.  
> > Use a partial.
> > 
> > Fred

I have one more problem regarding using ajax, I want to show and hide  
div on mouseover and mouseout events of another div, but it doesn’t  
work, it continuously does same thing I am expecting some code or  
solution for it… 🙂 Have a nice time… Fred
