Help index for buyers and sellers

Hi Alex, I want to create pages for buyers and sellers which includes a help index, FAQ's, fee structure, sales messages, multiple CTA's, and other useful info. I tried doing this by defining a help page in the pages controller so the url is website.com/pages/help but i realized that I could not add additional pages to separate buyers from sellers e.g. pages/help/sell, I noticed that other site structures are website.com/help/sell/ etc. Should I use the generator to create these help pages in the console like we did with the about and contact pages using rails g controller help sell buy etc. to do this as a separate help controller or generate a seller controller and a buyer controller. I'd like to stick to rails best practice where possible and leave room for extending these "resources". Thanks

Posted about 5 years ago by Grant Brooks
Posted about 5 years ago by Alex Yang

Unless you want to create an extra help_pages controller to organize your code a little more, I think it's fine to just use the Pages controller we defined to hold all your static pages (informational pages that don't have any dynamic elements). I recommend you take a look at this Rails Guide on routing, which should help you understand the various URL possibilities and how to create them in your config/routes.rb file: http://guides.rubyonrails.org/routing.html.

In particular, note that you can manually set your URLs. For example, you could use the following code to customize a sample Help page URL:

get '/help/sell', to: 'pages#sell'

This code will set your Help Sell page to be found at website.com/help/sell instead of the default website.com/pages/sell (assuming that you've created a 'sell' action in your pages_controller.rb file). Hope this helps!

0