Hi --
On Mon, 20 Jul 2009, elliottg wrote:
>
> I have been using this namespaced form_for syntax with no problems:
> <% form_for [:admin, @products] do |f| %>
>
> However, now that I am working with a model and controller called
> "news" which has no differentiation between singular and plural...
>
> <% form_for [:admin, @news] do |f| %>
>
> ... I am getting this exception when running my tests:
>
>
> ActionView::TemplateError: admin_news_url failed to generate from
> {:controller=>"adminl/news", :action=>"show"} - you may have ambiguous
Is that "adminl" a typo in your code, or just in the email?
> routes, or you may need to supply additional parameters for this
> route. content_url has the following required parameters: ["admin",
> "news", :id] - are they all satisfied?
>
>
> Rake Routes is showing me that I can get news#index via
> sitecontrol_news_index.
>
> I just can't figure out the syntax to make it all work within the
> admin namespacing context.
I'm not sure exactly how you've got it set up, but starting at the
simplest case: if you have this in your routes.rb:
map.namespace :admin do |a|
a.resources :news
end
and if @news is a News object, and you've got an admin/news
controller, you should be OK.
David
--
David A. Black / Ruby Power and Light, LLC
Ruby/Rails consulting & training: http://www.rubypal.com
Now available: The Well-Grounded Rubyist (http://manning.com/black2)
Training! Intro to Ruby, with Black & Kastner, September 14-17
(More info: http://rubyurl.com/vmzN)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" 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/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---