Created
October 26, 2014 13:20
-
-
Save mib32/a1f0ac990576ef1c91f2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
routes.rb: | |
resources 'news', controller: 'posts', type: 'NewsPost' | |
get 'posts(/:id)', to: redirect('/news/%{id}') | |
news_post.rb: | |
class NewsPost < Post | |
def type_name | |
'Новость' | |
end | |
def self.model_name | |
Post.model_name | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment