# RJS redirect\_to / Effect.scrollTo

**URL:** <https://www.ruby-forum.com/t/rjs-redirect-to-effect-scrollto/89171>\
**Category:** Rails\
**Created:** [March 18, 2007, 4:08am UTC](https://www.ruby-forum.com/t/rjs-redirect-to-effect-scrollto/89171 "2007-03-18T04:08:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![daveh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/85e7bf/32.png) [@daveh](https://www.ruby-forum.com/u/daveh)\
**Post date:** [March 18, 2007, 4:08am UTC](https://www.ruby-forum.com/t/rjs-redirect-to-effect-scrollto/89171/1 "2007-03-18T04:08:35Z")

</div>

Hi there,

Is this even possible to do something like this in an RJS template?

page.redirect\_to url\_for(:action =\> ‘index’, :controller =\> ‘posts’)  
page \<\< “new Effect.ScrollTo(‘scroll\_to\_specified\_id’);”

The redirect\_to works, but the ScrollTo doesn’t get executed.

Any ideas or workarounds?

Thanks,  
Dave
