Rails 2 to 3 routes question

4 views
Skip to first unread message

Jeremy Woertink

unread,
Aug 30, 2011, 4:45:55 PM8/30/11
to rubyonra...@googlegroups.com
I had this app in rails 2.3 and had this route

map.resources :oker_training, :as => 'oker-training'

it did everything correctly, and displayed the url as
"/oker-training".
To get the same effect in rails 3, I had to do this

resources 'oker-training', :as => :oker_training, :controller =>
:oker_training.

My routes file is now 30% larger than before :( Is there a cleaner way
to write that?


Jeremy


(had to call it "oker" because it thought I was spamming. lol)

--
Posted via http://www.ruby-forum.com/.

Tim Shaffer

unread,
Aug 30, 2011, 7:21:12 PM8/30/11
to rubyonra...@googlegroups.com
Give this a whirl:

resources :oker_training, :path => '/oker-training'

Jeremy Woertink

unread,
Aug 31, 2011, 4:14:26 PM8/31/11
to rubyonra...@googlegroups.com
Tim Shaffer wrote in post #1019291:

> Give this a whirl:
>
> resources :oker_training, :path => '/oker-training'

wow... that worked, and I have no clue why I didn't try using path....

Thanks! Time to go clean up all of my routes files (yes, I have more
than 1 >_< )


~Jeremy

Reply all
Reply to author
Forward
0 new messages