Doubts with link_to function

i have seen one* link_to* function, but i didn’t get the path flow.
which
written in that function. PLZ any one clear dat function

<%= link_to “Loyalty Report”, report_listing_path(@listing, :format =>
“csv”) unless @listing.parent %>

*
*
*
*
Thank you
vishnu

On Wed, Dec 7, 2011 at 7:26 AM, amvis [email protected] wrote:

i have seen one link_to function, but i didn’t get the path flow. which
written in that function. PLZ any one clear dat function

<%= link_to “Loyalty Report”, report_listing_path(@listing, :format =>
“csv”) unless @listing.parent %>

What exactly you don’t get?
Have you seen the generated HTML for this?

The report_listing_path is a resource’s route helper function. If this
is what you don’t understand, you should take a look at

Hope it helps.

Cheers.


Leonardo M…
There’s no place like ~

i have look this Rails Routing from the Outside In — Ruby on Rails Guides. but i
didn’t
get one thing…

lets take one example * <%= link_to “Loyalty Report”,
report_listing_path(@listing, :format => “csv”) . *so what i am seeing
the
above link is

new_photo_path returns /photos/new.so if it like dis the **
report_listing_path
will return listing/report…is ti correct?

*
*
Thank You
vishnu

"report_listing_path will return the path to whatever route you have
defined as “report_listing”

You can run “rake routes” from the command line to see which routes you
have configured in your application.