you need Post resource and corresponding routes in config / routes.rb
just do "rails g resource post title: string content: text", for example, to create it. the route in the "redirect_to post" is processed dynamically. an instance of the post message is passed as an argument to the redirect_to method, as a result of which the page is redirected to the # show action message and passes the identifier of this Post instance. he "solves magic"
source share