# Call a method

**URL:** <https://www.ruby-forum.com/t/call-a-method/80560>\
**Category:** Rails\
**Created:** [December 28, 2006, 5:55pm UTC](https://www.ruby-forum.com/t/call-a-method/80560 "2006-12-28T17:55:42Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mr\_brownstone](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/59ef9b/32.png) [@mr\_brownstone](https://www.ruby-forum.com/u/mr_brownstone)\
**Post date:** [December 28, 2006, 5:55pm UTC](https://www.ruby-forum.com/t/call-a-method/80560/1 "2006-12-28T17:55:42Z")

</div>

I have the following method:

```
def pop_session
    session[:view_pop] = :valor
  end
```

This is only input value in session.In view, have one table:

```
<%= link_to cliente.id, :controller => "view",:action =>
"pop_session", :valor => cliente.id%>

But be calling the view this method.

"Template is missing
Missing template ./script/../config/../app/views/view/pop_session.rhtml"

I want only call the method "pop_session" from
```

---

<div class="post-metadata">

**Author:** ![mr\_brownstone](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/59ef9b/32.png) [@mr\_brownstone](https://www.ruby-forum.com/u/mr_brownstone)\
**Post date:** [December 28, 2006, 6:55pm UTC](https://www.ruby-forum.com/t/call-a-method/80560/2 "2006-12-28T18:55:11Z")

</div>

Marcelo J. wrote:

> \<%= link\_to cliente.id, :controller =\> "view",:action =\> "pop\_session", :valor =\> cliente.id%\>
> 
> But be calling the view this method.
> 
> “Template is missing  
> Missing template ./script/…/config/…/app/views/view/pop\_session.rhtml”
> 
> I want only call the method “pop\_session” from

And when the user clicks on your link what do you expect to happen?

Try render :nothing =\> true, but this might not exactly provide the  
bese usability…

–  
Phlip  
[http://c2.com/cgi/wiki?ZeekLand](http://c2.com/cgi/wiki?ZeekLand) ← NOT a blog!!

---

<div class="post-metadata">

**Author:** ![mr\_brownstone](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/59ef9b/32.png) [@mr\_brownstone](https://www.ruby-forum.com/u/mr_brownstone)\
**Post date:** [December 28, 2006, 7:24pm UTC](https://www.ruby-forum.com/t/call-a-method/80560/3 "2006-12-28T19:24:29Z")

</div>

> Phlip wrote:
> 
> And when the user clicks on your link what do you expect to happen?
> 
> Try render :nothing =\> true, but this might not exactly provide the  
> bese usability…
> 
> –  
> Phlip  
> [http://c2.com/cgi/wiki?ZeekLand](http://c2.com/cgi/wiki?ZeekLand) ← NOT a blog!!

I only want insert a value in a session.

Well, I made thus:

\<%= link\_to cliente.id,:controller =\> "view",:action =\> "pop\_session", :valor =\> cliente.id,:nothing =\> true %\>

Now appear the followning:

“Unknown action  
No action responded to list”

And more.

I want that when the focus in a text\_field, the value of session appear  
this text\_field. How I make this?

---

<div class="post-metadata">

**Author:** ![mr\_brownstone](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/59ef9b/32.png) [@mr\_brownstone](https://www.ruby-forum.com/u/mr_brownstone)\
**Post date:** [December 28, 2006, 7:39pm UTC](https://www.ruby-forum.com/t/call-a-method/80560/4 "2006-12-28T19:39:12Z")

</div>

Now I placed the “render :nothing =\> true” in controller, and not appear  
that one message, but now appear in blank. I do not want that load no  
page, I only want to define a value for mine session.

---

<div class="post-metadata">

**Author:** ![mr\_brownstone](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/59ef9b/32.png) [@mr\_brownstone](https://www.ruby-forum.com/u/mr_brownstone)\
**Post date:** [December 28, 2006, 7:31pm UTC](https://www.ruby-forum.com/t/call-a-method/80560/5 "2006-12-28T19:31:18Z")

</div>

It forgives me!!!

The error “Unknown action No action responded to list”, not’s of  
“link\_to”, is of other…

Well, corrected error, the first message back to appear.  
“Template is missing  
Missing template ./script/…/config/…/app/views/view/pop\_session.rhtml”  
exactly with the “:nothing =\> true”

---

<div class="post-metadata">

**Author:** ![mr\_brownstone](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/59ef9b/32.png) [@mr\_brownstone](https://www.ruby-forum.com/u/mr_brownstone)\
**Post date:** [December 28, 2006, 7:47pm UTC](https://www.ruby-forum.com/t/call-a-method/80560/6 "2006-12-28T19:47:21Z")

</div>

Marcelo J. wrote:

> Now I placed the “render :nothing =\> true” in controller, and not appear  
> that one message, but now appear in blank. I do not want that load no  
> page, I only want to define a value for mine session.

That’s what I figured would happen. link\_to is just like an  
old-fashioned

 

Try, uh, link\_to\_remote…

 

–  
Phlip  
 [http://c2.com/cgi/wiki?ZeekLand](http://c2.com/cgi/wiki?ZeekLand) ← NOT a blog!!
