Hi Nathan,
What you want is this:
<%= link_to ''Enter a new record in the log'', :controller
=> ''log'',
:action=> ''new'' %>
If you don''t specify the controller, it defaults to the current
controller.
Tom
On 9/27/05, Nathan Mealey <nathan-mPKOtHdLgT0QaXB9iyTzyw@public.gmane.org>
wrote:> I''m trying to link from an action in one controller to an action
in another,
> like this:
>
> - A user logs in and gets the ''index'' action for
rider_controller.rb, which
> displays index.rhtml
> - The index.rhtml page has a series of links, one of which should take the
> rider the ''new'' action of log_controller.rb, where they
can input new
> information
>
> But I am terribly confused on how to set up the URL reference. Currently I
> have this:
> <%= link_to ''Enter a new record in the log'',
:action=> ''/log/new'' %>
>
> This creates the url: localhost:3000/rider/log/new
> What I want the url to be is: localhost:3000/log/new
>
> Any help is incredibly appreciated.
>
> Thanks!
> --
>
>
> Nathan Mealey
>
> Website Manager & Administrative Director
>
> Cycle-Smart, Inc.
>
> P.O. Box 1482
>
> Northampton, MA
>
> 01061-1482
>
> nathan-mPKOtHdLgT0QaXB9iyTzyw@public.gmane.org
>
> (413) 210-7984
>
> (512) 681-7043 Fax
>
>
> _______________________________________________
> Rails mailing list
> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
>
>