[Radiant] map.resources and extensions

Mark Kirby mark at fishladder.co.uk
Sat Mar 1 06:46:22 CST 2008


Hi list,

I am tracking radiant svn and am setting up a new extension following  
the tutorial.

I have the extension loading up and am using scaffold generated by  
rails 2.

The problem i am having is that i get a lot of

undefined method `project_path' for #<ActionView::Base:0x34205ec>  
errors.

Not being very good at routing i was hoping someone could help.

in my routes i have

define_routes do |map|

      map.namespace(:admin) do |admin|
         admin.resources :projects
      end
    end

rake routes shows they are set up correctly, but if i include  
something like (this is stock rails scaffold)

  <tr>
      <td><%=h project.name %></td>
      <td><%=h project.mailing_list %></td>
      <td><%= link_to 'Show', project %></td>  ** This line trips the  
error **
      <td><%= link_to 'Edit', edit_project_path(project) %></td>
      <td><%= link_to 'Destroy', project, :confirm => 'Are you  
sure?', :method => :delete %></td>
</tr>

It gives me the above error.

Anyone have an idea? does map.resources work with extensions or am i  
going to have to wright named routes instead?

Thanks

Mark Kirby


More information about the Radiant mailing list