satynos
unread,Dec 15, 2008, 5:36:35 PM12/15/08Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to resources_controller
def resource_named_route_helper_method?(resource_method, raise_error =
false)
if resource_method.to_s =~ /_(path|url)$/ &&
resource_method.to_s =~ /(^|^.*_)enclosing_resource(s)?_/
_, route_method =
*route_and_method_from_enclosing_resource_method_and_name_prefix
(resource_method, name_prefix)
elsif resource_method.to_s =~ /_(path|url)$/ &&
resource_method.to_s =~ /(^|^.*_)resource(s)?_/
_, route_method =
*route_and_method_from_resource_method_and_name_prefix
(resource_method, name_prefix)
else
return false
end
respond_to_without_named_route_helper?(route_method) ||
(raise_error && raise_resource_url_mapping_error(resource_method,
route_method))
end
What exactly does the following lines imply:
if resource_method.to_s =~ /_(path|url)$/ && resource_method.to_s =~ /
(^|^.*_)enclosing_resource(s)?_/
_, route_method =
*route_and_method_from_enclosing_resource_method_and_name_prefix
(resource_method, name_prefix)
and where are we getting the name_prefix from?
Thanks in advance.