Hier sind meine Rails 2 Routen:Gibt es eine bessere Möglichkeit, mit Optionen in Rails 3 Routen zu tun?
map.with_options :controller => 'foo', :conditions => { :method => :post } do |foo|
foo.one 'one', :action => 'one'
foo.two 'two', :action => 'two'
foo.with_options :special_flag => 'true', :path_prefix => 'special_prefix',
:conditions => { :method => :get } do |bar|
bar.three '', :action => 'for_blank'
bar.four 'another', :action => 'for_another'
end
end
Wie konvertiere ich diese Art der Sache 3 zu Rails? Benutze einfach with_options auf die gleiche Weise? Es wird in einigen Fällen wortreicher weil statt
match '' => 'foo#for_blank'
tun
match '', :action => 'for_blank'
süß. auch ich kann über und lassen 'post' eins 'und' post 'zwei' ', ja? –
@ John: Das stimmt. –