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 8999467
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:11:03+00:00 2026-06-16T00:11:03+00:00

rb file code SampleApp::Application.routes.draw do get static_pages/home match ‘/help’ to:’static_pages#help’ match ‘/about’ to:’static_pages#about’ match

  • 0

rb file code

SampleApp::Application.routes.draw do
  get "static_pages/home"


match '/help' to:'static_pages#help'
match '/about' to:'static_pages#about'
match '/contact' to:'static_pages#contact'


  # The priority is based upon order of creation:
  # first created -> highest priority.

  # Sample of regular route:
  #   match 'products/:id' => 'catalog#view'
  # Keep in mind you can assign values other than :controller and :action

  # Sample of named route:
  #   match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase
  # This route can be invoked with purchase_url(:id => product.id)

  # Sample resource route (maps HTTP verbs to controller actions automatically):
  #   resources :products

  # Sample resource route with options:
  #   resources :products do
  #     member do
  #       get 'short'
  #       post 'toggle'
  #     end
  #
  #     collection do
  #       get 'sold'
  #     end
  #   end

  # Sample resource route with sub-resources:
  #   resources :products do
  #     resources :comments, :sales
  #     resource :seller
  #   end

  # Sample resource route with more complex sub-resources
  #   resources :products do
  #     resources :comments
  #     resources :sales do
  #       get 'recent', :on => :collection
  #     end
  #   end

  # Sample resource route within a namespace:
  #   namespace :admin do
  #     # Directs /admin/products/* to Admin::ProductsController
  #     # (app/controllers/admin/products_controller.rb)
  #     resources :products
  #   end

  # You can have the root of your site routed with "root"
  # just remember to delete public/index.html.
  # root :to => 'welcome#index'

  # See how all your routes lay out with "rake routes"

  # This is a legacy wild controller route that's not recommended for RESTful applications.
  # Note: This route will make all actions in every controller accessible via GET requests.
  # match ':controller(/:action(/:id))(.:format)'
end

its showing me an error

syntax error, unexpected tIDENTIFIER, expecting keyword_end
match '/contact' to:'static_pages#contact'
                   ^
    from /home/ritesh/.rvm/gems/ruby-1.9.3-p327/gems/activesupport-3.2.9/lib/active_support/dependencies.rb:245:in `block in load'
    from /home/ritesh/.rvm/gems/ruby-1.9.3-p327/gems/activesupport-3.2.9/lib/active_support/dependencies.rb:236:in `load_dependency'
    from /home/ritesh/.rvm/gems/ruby-1.9.3-p327/gems/activesupport-3.2.9/lib/active_support/dependencies.rb:245:in `load'
    from /home/ritesh/.rvm/gems/ruby-1.9.3-p327/gems/railties-3.2.9/lib/rails/application/routes_reloader.rb:40:in `block in load_paths'
    from /home/ritesh/.rvm/gems/ruby-1.9.3-p327/gems/railties-3.2.9/lib/rails/application/routes_reloader.rb:40:in `each'
    from /home/ritesh/.rvm/gems/ruby-1.9.3-p327/gems/railties-3.2.9/lib/rails/application/routes_reloader.rb:40:in `load_paths'
    from /home/ritesh/.rvm/gems/ruby-1.9.3-p327/gems/railties-3.2.9/lib/rails/application/routes_reloader.rb:16:in `reload!'
    from /home/ritesh/.rvm/gems/ruby-1.9.3-p327/gems/railties-3.2.9/lib/rails/application/routes_reloader.rb:26:in `block in updater'
    from /home/ritesh/.rvm/gems/ruby-1.9.3-p327/gems/activesupport-3.2.9/lib/active_support/file_update_checker.rb:78:in `call'
    from /home/ritesh/.rvm/gems/ruby-1.9.3-p327/gems/activesupport-3.2.9/lib/active_support/file_update_checker.rb:78:in `execute'
    from /home/ritesh/.rvm/gems/ruby-1.9.3-p327/gems/railties-3.2.9/lib/rails/application/routes_reloader.rb:27:in `updater'
    from /home/ritesh/.rvm/gems/ruby-1.9.3-p327/gems/railties-3.2.9/lib/rails/application/routes_reloader.rb:7:in `execute_if_updated'
    from /home/ritesh/.rvm/gems/ruby-1.9.3-p327/gems/railties-3.2.9/lib/rails/application/finisher.rb:66:in `block in <module:Finisher>'
    from /home/ritesh/.rvm/gems/ruby-1.9.3-p327/gems/railties-3.2.9/lib/rails/initializable.rb:30:in `instance_exec'
    from /home/ritesh/.rvm/gems/ruby-1.9.3-p327/gems/railties-3.2.9/lib/rails/initializable.rb:30:in `run'
    from /home/ritesh/.rvm/gems/ruby-1.9.3-p327/gems/railties-3.2.9/lib/rails/initializable.rb:55:in `block in run_initializers'
    from /home/ritesh/.rvm/gems/ruby-1.9.3-p327/gems/railties-3.2.9/lib/rails/initializable.rb:54:in `each'
    from /home/ritesh/.rvm/gems/ruby-1.9.3-p327/gems/railties-3.2.9/lib/rails/initializable.rb:54:in `run_initializers'
    from /home/ritesh/.rvm/gems/ruby-1.9.3-p327/gems/railties-3.2.9/lib/rails/application.rb:136:in `initialize!'
    from /home/ritesh/.rvm/gems/ruby-1.9.3-p327/gems/railties-3.2.9/lib/rails/railtie/configurable.rb:30:in `method_missing'
    from /home/ritesh/projects/sample_app/config/environment.rb:5:in `<top (required)>'
    from /home/ritesh/projects/sample_app/spec/spec_helper.rb:3:in `require'
    from /home/ritesh/projects/sample_app/spec/spec_helper.rb:3:in `<top (required)>'
    from /home/ritesh/projects/sample_app/spec/requests/static_pages_spec.rb:1:in `require'
    from /home/ritesh/projects/sample_app/spec/requests/static_pages_spec.rb:1:in `<top (required)>'
    from /home/ritesh/.rvm/gems/ruby-1.9.3-p327/gems/rspec-core-2.9.0/lib/rspec/core/configuration.rb:746:in `load'
    from /home/ritesh/.rvm/gems/ruby-1.9.3-p327/gems/rspec-core-2.9.0/lib/rspec/core/configuration.rb:746:in `block in load_spec_files'
    from /home/ritesh/.rvm/gems/ruby-1.9.3-p327/gems/rspec-core-2.9.0/lib/rspec/core/configuration.rb:746:in `map'
    from /home/ritesh/.rvm/gems/ruby-1.9.3-p327/gems/rspec-core-2.9.0/lib/rspec/core/configuration.rb:746:in `load_spec_files'
    from /home/ritesh/.rvm/gems/ruby-1.9.3-p327/gems/rspec-core-2.9.0/lib/rspec/core/command_line.rb:22:in `run'
    from /home/ritesh/.rvm/gems/ruby-1.9.3-p327/gems/rspec-core-2.9.0/lib/rspec/core/runner.rb:69:in `run'
    from /home/ritesh/.rvm/gems/ruby-1.9.3-p327/gems/rspec-core-2.9.0/lib/rspec/core/runner.rb:10:in `block in autorun'

why this syntax error is coming i think this code line is correct written
match ‘/contact’ to:’static_pages#contact’
please help to rectify it.

  • 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-16T00:11:04+00:00Added an answer on June 16, 2026 at 12:11 am

    You forgot commas before to:

    match '/help', to:'static_pages#help'
    match '/about', to:'static_pages#about'
    match '/contact', to:'static_pages#contact'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this code in my routes.db file: resources :users do member do get
I'm calling a jQuery GET on the test.php file code below. I'm trying to
The author, Michael Hartl, says: Here the rule: get static_pages/home maps requests for the
File name and extension are empty. Please help. ASPX FILE CODE: <tr> <td colspan=3
my views.py file code: #!/usr/bin/python from django.template import loader, RequestContext from django.http import HttpResponse
I'm looking for batch file code that will copy folders specified in a text
How to edit the .fla file code and save it in the .swf format?
I've not had to write much batch file code in the past and I'm
Code: file('pinax/media/a.jpg', 'wb')
This is my code: File TempFiles = new File(Tempfilepath); if (TempFiles.exists()) { String[] child

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.