I want redirect to another controller but without change the address in
the address bar of browser.
Then is possible to render a page from another controller?
Thanks
I want redirect to another controller but without change the address in
the address bar of browser.
Then is possible to render a page from another controller?
Thanks
Luca R. wrote:
I want redirect to another controller but without change the address in
the address bar of browser.Then is possible to render a page from another controller?
If you move the method you wish to call into a controller that
is a parent of both controllers you can just call that method
from the requested method. Add a render(:template) call to
the destination method to ensure that the right view is rendered.
If you don’t need to call the other controller’s action, just
add the render(:template) call to the requested action when you
want to “redirect”.
–
We develop, watch us RoR, in numbers too big to ignore.
mmm and how i can to passing an id to template?
ex. i want to render “controller/action/10”
Thanks for the responce
Mark Reginald J. wrote:
Luca R. wrote:
I want redirect to another controller but without change the address in
the address bar of browser.Then is possible to render a page from another controller?
If you move the method you wish to call into a controller that
is a parent of both controllers you can just call that method
from the requested method. Add a render(:template) call to
the destination method to ensure that the right view is rendered.If you don’t need to call the other controller’s action, just
add the render(:template) call to the requested action when you
want to “redirect”.–
We develop, watch us RoR, in numbers too big to ignore.
Must i to use render_component?
–
We develop, watch us RoR, in numbers too big to ignore.
Luca R. wrote:
mmm and how i can to passing an id to template?
ex. i want to render “controller/action/10”
There are several ways to pass parameters between actions
during one request: controller instance variables, writing
to the params hash, method parameters (use defaults to ensure
it works with no arguments), and flash.now.
–
We develop, watch us RoR, in numbers too big to ignore.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs