Is there a way to use the "link_to" function in a controller?
Why would you want to be doing that? link_to generates HTML, which has no place in a controller. Perhaps you''re looking for redirect_to - <http://api.rubyonrails.com/classes/ActionController/Base.html#M000170> On 7/3/05, Steve Downey <sldowney-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org> wrote:> Is there a way to use the "link_to" function in a controller? > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- Chris Johnson cj-lHH7W0eyjmpWk0Htik3J/w@public.gmane.org
> > Why would you want to be doing that? link_to generates HTML, which > has no place in a controller. > > Perhaps you''re looking for redirect_to - > <http://api.rubyonrails.com/classes/ActionController/Base.html#M000170> > > On 7/3/05, Steve Downey <sldowney@...> wrote: > > Is there a way to use the "link_to" function in a controller? > > > > _______________________________________________ > > Rails mailing list > > Rails@... > > http://lists.rubyonrails.org/mailman/listinfo/rails > > >I am building a set of links to: first record, previous record, next record and last record. Most of the calculation will be in the controller (including the case of no next, etc.); rather than set four instance variables for use in the view, I''d like to just set one string that has all the links (HTML).
Sounds like something that would belong in a helper... _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails