Simple problem, I want to render a .rhtml file and have it jump to an anchor. Something like: http://localhost:3000/convs/show/170#conv-170-6887 Tried borrowing the URL_FOR style: render :action => show, :anchor => "conv-170-6887" But that didn''t work. Thanks in advance. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Brittain wrote:> Simple problem, I want to render a .rhtml file and have it jump to an > anchor. Something like: > > http://localhost:3000/convs/show/170#conv-170-6887 > > Tried borrowing the URL_FOR style: > > render :action => show, :anchor => "conv-170-6887" > > But that didn''t work. > > Thanks in advance.Since an anchor is really a browser convention to jump to somewhere on the page, you''ll need to use redirect_to in order to put the anchor in the browser''s address bar: redirect_to :action => show, :anchor => "conv-170-6887" -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
What other solution is posible intead of using redirect_to?
I''m having a similar problem while using redirect_to, the
error_messages_for does not persist.
I need to use render :action , :anchor
Maybe something like:
render :rjs => "Effect.ScrollTo(''anchor'')"
--
Posted via http://www.ruby-forum.com/.