title: How can I simplify this rails controllers for content pages?
body: <p>I have the following class, but it has a lot of duplicate code. Is there a way to simplify this so that I don't have to add a new method for each page record (this would also allow clients to add pages at will). Here is the current controller:</p>
  
  <pre><code>    class StaticController &lt; ApplicationController
        def privacy_policy
          @page = Page.find_by_slug 'privacy_policy'
          render 'static/page'
        end
  
        def terms
          @page = Page.find_by_slug 'terms'
          render 'static/page'
        end
  
        def about
          @page = Page.find_by_slug 'about'
          render 'static/page'
        end
      end
  </code></pre>