0

In my application i want to jump from one part of the page to another ...

but i am not getting how to code for that.

Help will be highly obliged

deefour
  • 34,974
  • 7
  • 97
  • 90

1 Answers1

0

you should use the html anchor

http://www.boogiejack.com/html/html-anchor-tag.html

Nick Ginanto
  • 31,090
  • 47
  • 134
  • 244
  • using anchor tag is fine but while redirecting i want to send that data also with dat link... – Barun Sharma Aug 04 '12 at 06:52
  • 2
    Careful here - the use of the name attribute like this is depreciated. You should instead use `id`.You can append #[some_id] to the end of any URL (before variables) and the browser will scroll the window to the top of that element. Eg http://en.wikipedia.org/wiki/Fragment_identifier#Basics (the URL text and that page). Id can be used on any element to this effect. – Stecman Aug 04 '12 at 06:55
  • i am not getting wat you are trying to say...<%= link_to 'Reply' %> this is my link wat should i do with it – Barun Sharma Aug 04 '12 at 07:09
  • Edit: Sorry, actually see http://www.ruby-forum.com/topic/81443 . What you want is the parameter `:anchor` . So `<%=link_to 'Reply', {:anchor=>'something'}%> – Stecman Aug 04 '12 at 07:15
  • This SO question may be helpful http://stackoverflow.com/questions/1888960/ruby-on-rails-link-to-internal-id – Stecman Aug 04 '12 at 07:21
  • it is working but url is not getting changed automatically.....or by refreshing the page.. – Barun Sharma Aug 04 '12 at 10:10
  • how can we use if condition for two anchors? – Barun Sharma Aug 04 '12 at 10:17