Hello all.
Looked through "polymorphic_url" method (used by "form_for",
"redirect_to" and other helpers) and observed that is no way to use it
with any of non-resource parameters. I.e if we got
resources :users, :scope => "/:somestring"
in our routes.rb config, that generates user_path(@user, { :somestring
=> "brazil" }) linked to http://site.com/brazil/users/1 it fails
i.e.
"form_for @user" and "redirect_to @user", cause it calls
method
user_path(@user) without :somestring
and if we write "form_for [{ :somestring => "brazil" },
@user]" it
fails on "build_named_route_call" method, which trying to convert
first Hash to string-part of named route method name.
Of course we have :url option fo "form_for", and we can use user_path
right in "redirect_to" but it seems ugly, and there is no good way
always to edit many lines of scaffolded code.
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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.