Answer the question
In order to leave comments, you need to log in
How to create simple pages on Rails?
Good day. I'm a complete newbie to rails and I have a question about page addresses.
How to most competently create pages like site.ru/about, site.ru/contacts, etc.
In the manuals, it is usually advised to create a controller and use the appropriate actions for the pages. But here it turns out that the page address will be site.ru/pages/about. How to remove this very pages from the address? I can't google anything about this
Answer the question
In order to leave comments, you need to log in
create a StaticPagesController
and set the route as
get 'contacts' => 'static_pages#contacts'
Decided like this - in routes.rb
Everything works, but how right / wrong is this? Is it normal to do this, or is it sotonism?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question