Forum: Ruby on Rails can i call another controller rhtml

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Madhankumar N. (Guest)
on 2007-05-30 14:07
hi all,
i have creater two controller, if i want to call the second cotroller
rhtml page from the first.....
how it will be....
if any one knows guide me....
Jean-Etienne D. (Guest)
on 2007-05-30 15:44
Madhankumar Nagaraj wrote:
> hi all,
> i have creater two controller, if i want to call the second cotroller
> rhtml page from the first.....
> how it will be....
> if any one knows guide me....

Hi,

It's probably not a good idea. Note that you can define some methods in
our application.rb, since all controllers inherit from
ApplicationController, you will "share' them amongst all controllers.

Regards,
Jason R. (Guest)
on 2007-05-30 17:32
(Received via mailing list)
On 5/30/07, Jean-Etienne D. <removed_email_address@domain.invalid>
wrote:
>
> It's probably not a good idea. Note that you can define some methods in
> our application.rb, since all controllers inherit from
> ApplicationController, you will "share' them amongst all controllers.
>
> Regards,
>
> --
> Posted via http://www.ruby-forum.com/.


Well, in some cases you do want to have common views across controllers,
though the way of accessing view files is all the same:

render "controller_name/view"

which corresponds to:

app/views/controller_name/view.rhtml

Jason
This topic is locked and can not be replied to.