mindsupport
mindsupport

Reputation: 488

Ruby On Rails strange routes path

I have this routes in my app (rails 3.2):

godmode_invites GET    /godmode/invites(.:format)                  godmode/invites#index
                        POST   /godmode/invites(.:format)                  godmode/invites#create
     new_godmode_invite GET    /godmode/invites/new(.:format)              godmode/invites#new
    edit_godmode_invite GET    /godmode/invites/:id/edit(.:format)         godmode/invites#edit
         godmode_invite GET    /godmode/invites/:id(.:format)              godmode/invites#show
                        PUT    /godmode/invites/:id(.:format)              godmode/invites#update
                        DELETE /godmode/invites/:id(.:format)              godmode/invites#destroy

And in template view:

    <td><%= link_to 'Show', godmode_invites_path(invite) %></td>
<td><%= link_to 'Destroy', godmode_invites_path(invite), method: :delete, data: { confirm: 'Are you sure?' } %></td>

This produces strange routes like with point before resource ID:

/godmode/invites.3 /godmode/invites.4

I can not find my problem...

Upvotes: 0

Views: 82

Answers (1)

HungryCoder
HungryCoder

Reputation: 7616

There is little error your in view. Here is the corrected code:

<td><%= link_to 'Show', godmode_invite_path(invite) %></td>
<td><%= link_to 'Destroy', godmode_invite_path(invite), method: :delete, data: { confirm: 'Are you sure?' } %></td>

Upvotes: 3

Related Questions