[Radiant] map.resources and extensions

Mark Kirby mark at fishladder.co.uk
Mon Mar 3 02:22:54 CST 2008


[sorry if this comes through twice]

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.

if i also add map.resources :projects the links work but so do the  
non admin prefixed links.

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

Will the wiki be updated to reflect the lack of automatic scaffold in  
rails now?

Thanks

Mark Kirby



More information about the Radiant mailing list