error in using link_to

Hi, Problem is

<%= link_to "Index", {:controller => "account", :action => "index" }, :style => "text-decoration:none" %>

above, the link_to is not generating the necessary code it has to generate

It is generating

        <a href="/" style="text-decoration:none">Index</a>

But it has to generate

        <a href="/account/index" style="text-decoration:none">Index</a>

can anyone solve this.

Aashish Kiran wrote:

Hi, Problem is

<%= link_to "Index", {:controller => "account", :action => "index" }, :style => "text-decoration:none" %>

above, the link_to is not generating the necessary code it has to generate

It is generating

        <a href="/" style="text-decoration:none">Index</a>

But it has to generate

        <a href="/account/index" style="text-decoration:none">Index</a>

can anyone solve this.

By digging deep i found that url_for(options) is not generating url can any one solve this.

Have you tried changing the link_to to find what it is that is causing the problem, removing the style, trying different controller and actions for example? If you can get to a working situation then work back to a failing one something may become clear, or at least less muddy.

Colin

What does your routes file look like ?

Fred

Frederick Cheung wrote:

What does your routes file look like ?

my route.rb file

ActionController::Routing::Routes.draw do |map| map.connect '', :controller => "account", :action => "index"

It just goes to show how clever rails is, you asked for a link to account/index, it generated a link to / but your route says that / should go to account/index. So that's all right then.

Colin