I tried to extend the user model with

user has_one :artist  and artist belongs_to :user

And I defined this map in route.rb:

map.resources :artists

When I check the URL generated from the console:

>> rs = ActionController::Routing::Routes
>> rs.generate :controller=>"artist", :action=>"edit", :id=>"1"
=> "/artist/edit/1"

It is in the expected :controller/:action/:id format.

But when I call this route inside my app with CE in vendor:

link_to "Edit profile",
{ :controller=>"artists", :action=>"edit", :id=>current_user.artist.id }
or with
link_to "Edit profile", edit_artist_path(current_user.artist.id)

it instead generated:
/artists/1/edit

The :action and :id order in the URL got flipped around!

How can I get it to generate generate the standard URL? Thanks!

--

You received this message because you are subscribed to the Google Groups 
"CommunityEngine" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/communityengine?hl=en.


Reply via email to