problem with resources map

I am facing problem with resource map

I have controller of artst

class ArtistController < ApplicationController

in routes I have map.resources :artist

and in view

<%
for i in @artist %>

<%= i.id %> <%= i.name %> <%= i.created_at.strftime("%Y-%m-%d")%> <%= i.updated_at.strftime("%Y-%m-%d") %>

<%=
link_to ‘Edit’, edit_artist_path(i) %>

<%
end %>

edit_artist_path(i) produces link as artists/1/edit

and I want link as artists/edit/1

How can I do that ?

Internal Virus Database is out-of-date.

Checked by AVG Free Edition.

Version: 7.5.516 / Virus Database: 269.19.21/1263 - Release Date: 2/6/2008 8:14 PM

You're using the REST routes. 'artists/1/edit' is the expected result
for this.

If you want the default routes, you could just erase
map.resources :artists

and then the routing of artists/edit/1 will fall back onto the default
route, if this is still at the bottom of your routes.rb:
  map.connect ':controller/:action/:id'
this way 'artists/edit/1' will work.

HTH,

Elise

Muhammad Arslan Ali wrote:

That doesn't follow the rails way of doing things. You will find your life a lot easier if you "go with the flow" in regards to rails traditions. To get that url you could just stop using map.resources and specify <%= link_to 'Edit', { :controller > "artists", :action => "edit", :id => i.id } %> instead.