validation - Rails 2 Trailing Route Parameter -


I am creating an article / blog website where any article can be shown in a series of URL paths. .

  / section / article / section / page / article / section / page / page2 / article  

this works, but what if I Want page number

  / section / article / page / 123 / / section / page / article / page / 123 / section / page / page2 / article / page / 123  

Will it mean that I have to make a specific route for every different url?

  /: section /: page /: subpage  

This will mean that I'll create dozens of URL routing parameters.

Is it anyway to say that the URL has a one / page / NUMBER suffix at the end of the URL, and still the routine normally (which assigns NUMBER to a parameter and normally Going to page)?

root globing, which is described on, can work in this situation. For example, your route map.connect '/: section / * page_subpage_path / page /: number',: admin = & gt; Can read. 'Articles',: Action => 'Show'

This correct code probably will not work, but this method can be a good direction to try. Good luck :)


Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -