Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7752511
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T11:49:10+00:00 2026-06-01T11:49:10+00:00

I am developing a app in ruby on rails for a local business. The

  • 0

I am developing a app in ruby on rails for a local business. The pages are ‘static’, but changeable through a backend CMS I am building for them. Is there a best practice to creating a controller for static pages? Right now I have a sites controller with all static routes, like this.

routes.rb

get "site/home"
get "site/about_us"
get "site/faq"
get "site/discounts"
get "site/services"
get "site/contact_us"
get "site/admin"
get "site/posts"

or would I be better off creating member routes for the site controller like this without the crud, because a ‘Site’ will not need to have the CRUD.

resources :sites, :except => [:index, :new, :create, :update, :destroy]
member do
  get :home
  get :about_us
  get :faq
  get :discounts
  get :services
  get :contact_us
  get :admin
  get :posts
end

Or is there a best practice / better way? Any answers would be appreciated. Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T11:49:12+00:00Added an answer on June 1, 2026 at 11:49 am

    If the static pages list are not going to increase, then you can keep the list, but if you want a dynamic list like site/any_new_url , save the routes as

    get 'site/:cms_page' => 'cms#show' # all requests matching site/any_page will go CmsController, show method
    

    This will help reduce keep the routes from bloating, but the downside is you do not know what all routes are the valid ones. Your sample code can be

    def show
      @page_data = Page.find_by_page(:params[:cms_page])
    end
    

    show.html.erb

    <%= @page_data.html_safe %>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing a Ruby on Rails app and attempting to deploy it with
I'm developing a web app in Ruby-On-Rails. It heavily uses JavaScript. The problem is,
I am developing a Ruby on Rails app and I have a model called
I'm developing a Ruby 1.9.2 / Rails 3.2.2 app and recently I had to
I'm developing a ruby on rails app and I want to be able to
I am developing a ruby on rails app on OSX and I am logged
I am developing a Ruby on Rails app. My question is more about Ruby
I'm developing an e-store app using ruby on rails and I'm a bit confused
New to Ruby and Rails. I am developing a simple app for where you
I have a command line Ruby app I'm developing and I want to allow

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.