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.
265764299997c7176ca7316fc3bb87c7?d=identicon&s=25 Madhankumar Nagaraj (madhan)
on 2007-05-30 12: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....
Eb778b8bb642aa8a82c2b8b63705b6af?d=identicon&s=25 Jean-Etienne Durand (jetienne)
on 2007-05-30 13: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,
83ca41657a99b65d99889abe712ba5e2?d=identicon&s=25 Jason Roelofs (Guest)
on 2007-05-30 15:32
(Received via mailing list)
On 5/30/07, Jean-Etienne Durand <rails-mailing-list@andreas-s.net>
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.