Route segment ":controller" cannot be optional because it precedes a required segment

Hi,

With this route…

map.namespace :admin do |admin|
admin.sort ‘/:controller/sort/:sort_by/:sort_dir’, :action => ‘sort’
end

…I get this message…

Route segment “:controller” cannot be optional because it precedes a
required segment. This segment will be required.

The route works as expected, but the warning is worrying. Any ideas?

Thanks,

Dave

Dave,

Did you ever get any resolution on this? I’m just now having exactly
the same problem. I’m doing a filter though:

map.namespace :admin do |admin|
admin.filter ‘:controller/filter’, :action => ‘filter’
end

I wonder if there is some additional command-line hash option or
parameter that can be passed in?

This seems like something that would be fairly common… i.e. a common
extra action across multiple controllers?

-Danimal

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs