RailsCasts Pro episodes are now free!

Learn more or hide this

karen2k's Profile

GitHub User: karen2k

Comments by

Avatar

I've found only this way for routes.rb:

match 'ru/:page_id/:id' => 'subpages#show'

Avatar

Hi,

Thank you for this screencast!

But what if I have Page model

class Page < ActiveRecord::Base
has_many :subpages, :dependent => :destroy

def to_param
mnemoUrl
end
end

And I have Subpage model

class Subpage < ActiveRecord::Base
belongs_to :page
end

How may I use this method for urls like?
http://127.0.0.1:3000/{page_mnemoUrl}/{subpage_mnemoUrl}/