How do you accomplish page navigation with link_to. In other words I
want some way for <%= link_to … %> to output,
Is this possible?
Best,
Sam
How do you accomplish page navigation with link_to. In other words I
want some way for <%= link_to … %> to output,
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’, ‘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
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]
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