Page navigation with link_to

How do you accomplish page navigation with link_to. In other words I
want some way for <%= link_to … %> to output,

Name

Is this possible?

Best,
Sam

You can specify an anchor in any _to functions with :anchor. Like so:

<%= link_to “Name”, :controller => ‘controller’, :action =>
‘action’, :anchor: ‘PAGE_NAV’ %>

You may also want to set :skip_relative_url_root to false if you need
the root explicitly set.

j

On Aug 14, 9:23 am, Sam W. [email protected]

hi sam,
you can do this as joshua said,
and
some other methods, may be like this

  1. writer your on helper, some thing like this,
    (you can send what ever extra options you want and handle it
    

here,)

    def my_link_to_function(options)
         "<a href='#{RAILS_ROOT}/#{options[:url]}'>

#{options[:display_text]} "
end
2)
one more options is that link_to internally uses content_tag so
you can pass
directly pass :href options to link_to. (may be this leads to a
kind of hard coding)

P.s: sorry, if i din’t answer to your point.

On Aug 14, 9:23 pm, Sam W. [email protected]