I''m having this exact same problem.
I have a route of:
map.content ''sites/:site_short_name/*file'',
:controller => ''sites'',
:action => ''content'',
:requirements => { :site_short_name => /some_regex/ }
And I try to call
content_url :file => "search"
and it also "blows up" and says:
ActionView::TemplateError: content_url failed to generate from
{:action=>"content", :file=>"search",
:controller=>"sites"}, expected:
{:action=>"content", :controller=>"sites"}, diff:
{:file=>"search"}
I''ve looked into the rails source and this seems to be coming from:
actionpack/lib/action_controller/routing.rb line 1280 ( I have Rails
SVN revision REVISION_{2007-02-19}, so it''s 1.2-ish ).
The exception seems to be raised from line 1242 in the same file
because
path = named_route.generate(options, merged, expire_on)
is returning nil...
I''m planning on reading Jamis'' article: Under the hood: route
generation in Rails [
http://weblog.jamisbuck.org/2006/10/16/under-the-hood-route-generation-in-rails
], but I haven''t had a chance yet. I''m hoping there might be
some help
in there.
Nate Murray
http://pasadenarb.com/
On Mar 23, 7:01 pm, "Peter Harkins"
<goo...-geYGz4ndBgWvxtuIKfZzQg@public.gmane.org>
wrote:> I have an ActiveResourcenamedDiscussion. In my views, I often call
> discussion_path(@discussion) and I''d like to add on the post count
> (discussion.posts.count) as a get var. I''m want myurlsto be
like:http://nearbygamers.com/discussions/14?posts=3so that folks who''ve
> read a forum see blue links for discussions that have had posts added
> to them.
>
> I''ve tried adding options to the discussion_path call in my views
> which just blows up with various unhelpful messages (either that
> "discussion url failed to generate" or a call to nil.to_sym).
I''ve
> tried writing my own discussion_path helper with similar results. Any
> suggestions?
--~--~---------~--~----~------------~-------~--~----~
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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---