Monday 15 February 2010

javascript - Converting map.js in Rails routes.rb to new Rails 3 DSL -


I'm trying to change an old DSL style path. RB file that I am using for a new DSL style In Rail 3 Since most of it have regular routines, the conversion looks simple. Most of them just go like this:

  RailsRoot :: application.routes.draw do | Map | Root: from = & gt; "Index # index" match '/ table / made' = & gt; "Create table #" match '/ table / delete' = & gt; "Delete table #" More similar matching descriptions in the same multiplication-box map.js': Controller /: Action. Format 'End'   

I'm following the documentation to convert. If I'm reading this, then it looks like me, just surround me with the Draw map. can be removed and under the new DSL, : to tags unless otherwise stated, the statement of the match should be left in the form of more work (However, in my assumption I may be completely wrong and maybe my main problem may be.)

I think that when I come down from that line , Which is called map: JS: Controller /: Action .: format ', m There is no clue how to convert it to Rail 3 style DSL for routing. How would I go about converting it?

Edit # 1:

I have run a rock route after changing it with the suggestion of Iri ji, and it actually complains about the root If is not being defined, Iyuri ji probably gave me the right solution, but before I can verify it, I have to solve this problem before this.

Edit # 2:

I can not understand this. Since I have omitted all the example code in this part, I thought I do not need it anymore. However, what I was missing was the line: RailsRoot :: application.routes.draw do and then leaving the rest of the block. I'm still feeling very stupid. Anyway, Iyuri ji was on the right money. Thanks a bunch!

As the first Libri ji said, the correct way to change it is by changing it:

match: controller (/: verb (/: id)) (.: Format) '

No comments:

Post a Comment