Hello, Currently my links in Rails are using link_to as follows: <%= link_to project.name, project %> Which makes something like: `<a href="/projects/1">Project 1</a>` I''m working to implement an AJAX app with deep linking so instead of the above, I want the output to be (with a #): `<a href="#/projects/ 1">Project 1</a>` Is there a way to get this to work with link_to? Or do I need some type of custom helper so I can use something like `link_deep_to` Thanks -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Butu
2010-Oct-04 01:45 UTC
Re: Rails 3 - Using link_to but adding a # for AJAX Deep Linking
Hi, Try with <%= link_to project.name, "#" + project %> or <%= link_to project.name, "#" + projects_path %> Please let me know if it doesn''t work out. Thanks! Butu On Mon, Oct 4, 2010 at 7:12 AM, nobosh <bhellman1-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hello, > > Currently my links in Rails are using link_to as follows: > > <%= link_to project.name, project %> > > Which makes something like: `<a href="/projects/1">Project 1</a>` > > I''m working to implement an AJAX app with deep linking so instead of > the above, I want the output to be (with a #): `<a href="#/projects/ > 1">Project 1</a>` > > Is there a way to get this to work with link_to? Or do I need some > type of custom helper so I can use something like `link_deep_to` > > Thanks > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
nobosh
2010-Oct-04 15:50 UTC
Re: Rails 3 - Using link_to but adding a # for AJAX Deep Linking
thanks! On Oct 3, 6:45 pm, Butu <but...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, > > Try with > <%= link_to project.name, "#" + project %> > or > <%= link_to project.name, "#" + projects_path %> > > Please let me know if it doesn''t work out. > > Thanks! > Butu > > > > On Mon, Oct 4, 2010 at 7:12 AM, nobosh <bhellm...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > Hello, > > > Currently my links in Rails are using link_to as follows: > > > <%= link_to project.name, project %> > > > Which makes something like: `<a href="/projects/1">Project 1</a>` > > > I''m working to implement an AJAX app with deep linking so instead of > > the above, I want the output to be (with a #): `<a href="#/projects/ > > 1">Project 1</a>` > > > Is there a way to get this to work with link_to? Or do I need some > > type of custom helper so I can use something like `link_deep_to` > > > Thanks > > > -- > > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > For more options, visit this group athttp://groups.google.com/group/rubyonrails-talk?hl=en.-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Marnen Laibow-Koser
2010-Oct-04 16:23 UTC
Re: Rails 3 - Using link_to but adding a # for AJAX Deep Linking
Butu wrote:> Hi, > > Try with > <%= link_to project.name, "#" + project %> > or > <%= link_to project.name, "#" + projects_path %> > > Please let me know if it doesn''t work out.Minor syntax point: "##{project}" is actually more efficient than "#" + project , since it generates fewer String objects.> > Thanks! > ButuBest, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
nobosh
2010-Oct-04 17:52 UTC
Re: Rails 3 - Using link_to but adding a # for AJAX Deep Linking
Very nice! thank you both On Oct 4, 9:23 am, Marnen Laibow-Koser <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Butu wrote: > > Hi, > > > Try with > > <%= link_to project.name, "#" + project %> > > or > > <%= link_to project.name, "#" + projects_path %> > > > Please let me know if it doesn''t work out. > > Minor syntax point: "##{project}" is actually more efficient than "#" + > project , since it generates fewer String objects. > > > > > Thanks! > > Butu > > Best, > -- > Marnen Laibow-Koserhttp://www.marnen.org > mar...-sbuyVjPbboAdnm+yROfE0A@public.gmane.org > -- > Posted viahttp://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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.