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

  • SEARCH
  • Home
  • 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 7442407
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T11:10:15+00:00 2026-05-29T11:10:15+00:00

I want to code simple app, with index and about page, without using db,

  • 0

I want to code simple app, with index and about page, without using db, all text will be in views. But I can’t call my controller methods, to change view.
Here is controller (home_controller.rb)

class HomeController < ApplicationController

  def index
  end

  def about
  end

end

layout:

!!!
%html
  %head
    %title Title
    = stylesheet_link_tag "application"
    = javascript_include_tag "application"
    = csrf_meta_tags
  %body
    .wrapper
      = yield
      .footer

home index view:

%h2 Index
%h1
  This is example page
%p
  = link_to "Home", root_path
  = link_to "About", :controller => "home", :action => "index"
%p
  "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."

about view:

%h2 About
%h1
  This is about page
%p
  = link_to "Home", root_path
  = link_to "About", :controller => "home", :action => "about"
%p
  Lorem ipsum

in routes.rb I have root :to => 'home#index'

when i call my domain, i’ll get index, when i write: domain/home/index I get

No route matches [GET] “/home/index”

when I call about, it’s the same, how can I call my pages?
rake routes give me:

root / {:controller=>”home”, :action=>”index”}

  • 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-05-29T11:10:15+00:00Added an answer on May 29, 2026 at 11:10 am

    You should define those routes as well. They won’t appear automatically.

    For example, here’s what you can find in default generated routes.rb (at the end).

      # 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)))'
    

    Uncomment this and you should be able to access /home/index and /home/about.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

who can give me a simple code , i want a simplest way to
I want to write a simple task which will update and commit source code
I want to code a simple form layout in flex. Something like the following:
i want to do this simple piece of code work. #include <iostream> #include <windows.h>
I want to create a simple bit of JS code that creates an image
We want to do some fairly simple analysis of user's C++ code and then
I have a simple function that I want to call in the code behind
I want to write a simple web proxy, for exercise. Here's the code I
I only want a simple Splash Screen Example. Get the Code, Insert my picture,
I have got a simple web app in development, i want to establish a

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.