# RubyOnRails - One view, many actions

**URL:** <https://www.ruby-forum.com/t/rubyonrails-one-view-many-actions/119880>\
**Category:** Ruby\
**Created:** [November 11, 2007, 9:35pm UTC](https://www.ruby-forum.com/t/rubyonrails-one-view-many-actions/119880 "2007-11-11T21:35:52Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [November 11, 2007, 9:35pm UTC](https://www.ruby-forum.com/t/rubyonrails-one-view-many-actions/119880/1 "2007-11-11T21:35:52Z")

</div>

Hi all,  
I’ve got a view named "prompt.rhtml"and a controller named “customer”  
with some actions (“prompt”, “getdata”, and so on…). Of course, the  
URL “/customer/prompt” is associated to the action “prompt” and then  
to the view “prompt.rhtml”, but is it possible to associate the action  
“getdata” with the view “prompt.rhtml”? If so, how can I do this?

Thanks,  
Matthew

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [November 11, 2007, 9:54pm UTC](https://www.ruby-forum.com/t/rubyonrails-one-view-many-actions/119880/2 "2007-11-11T21:54:00Z")

</div>

On Nov 11, 2007 12:35 PM, [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> 

render :action =\> “prompt”

or

render :template =\> “customer/prompt”

Pat

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [November 12, 2007, 9:30am UTC](https://www.ruby-forum.com/t/rubyonrails-one-view-many-actions/119880/3 "2007-11-12T09:30:59Z")

</div>

On 11 Nov, 21:53, Pat M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > Matthew
> 
> render :action =\> “prompt”
> 
> or
> 
> render :template =\> “customer/prompt”
> 
> Pat

Hi Pat,  
if I use

render :action =\> “prompt”

in “getdata” action, I have:

getdata (action) → prompt (action) → prompt (view)

but I’d like to have:

getdata (action) → prompt (view)

Is it possible?

Thank you,  
Matthew

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [November 12, 2007, 10:04am UTC](https://www.ruby-forum.com/t/rubyonrails-one-view-many-actions/119880/4 "2007-11-12T10:04:18Z")

</div>

On Nov 12, 2007 1:02 AM, Pat M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > > > to the view “prompt.rhtml”, but is it possible to associate the action
> > 
> > getdata (action) → prompt (action) → prompt (view)
> 
> What? No you don’t. It just runs the getdata action and renders the  
> view that corresponds to the action named “prompt.” It doesn’t run  
> that other action. Anyway, I also showed you another way with render  
> :template.
> 
> Pat

Also I just noticed this is on rubytalk…you should direct any Rails  
messages to the rails mailing list.

Pat

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [November 12, 2007, 10:03am UTC](https://www.ruby-forum.com/t/rubyonrails-one-view-many-actions/119880/5 "2007-11-12T10:03:08Z")

</div>

On Nov 12, 2007 12:30 AM, [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > 
> 
> but I’d like to have:

What? No you don’t. It just runs the getdata action and renders the  
view that corresponds to the action named “prompt.” It doesn’t run  
that other action. Anyway, I also showed you another way with render  
:template.

Pat
