Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create Dynamic Pages in Ruby on Rails

What's the best solution to creating dynamic pages in Rails? I'm working on a simple admin interface where I want to be able to create pages of content and have them dynamically added to the site without having to have them added to the controller.

Ie, don't want to do this in pages controller.

def about
...
end

def privacy
...
end

I was thinking of doing something like have all pages use the show action which looks at url by permalink and fetches that from the database although I'm not sure the best approach to doing this. Any feedback on this would be great.

like image 458
Robert B Avatar asked Apr 08 '26 10:04

Robert B


1 Answers

I think this is exactly what you need: Railscast - Semi-Static Pages

like image 129
Zabba Avatar answered Apr 10 '26 23:04

Zabba



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!