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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T14:11:31+00:00 2026-06-04T14:11:31+00:00

I’m having trouble understanding routing. Plus I’m trying to understand the resources (and resource)

  • 0

I’m having trouble understanding routing. Plus I’m trying to understand the resources (and resource) key word in routes.rb.

I created home_controller.rb, and put “resources :home” in routes.rb. I ran rake routes, and i can see all that stuff, but I don’t know what to do with it. I simply want to display a page with a form, say index.html.erb, submit the form, do something in the controller, then display the exact same page again.

I think I want to invoke a PUT “/home”, or something, but I’m not sure what my href should look like in the erb page.

Then, what method in home_controller.rb will capture that submit?

Then, do I do a redirect back to index.html.erb, perhaps?

I’m trying not to use scaffolding or generators, so that I can understand what is going on. Any help appreciated. btw, rails 3.

  • 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-04T14:11:32+00:00Added an answer on June 4, 2026 at 2:11 pm

    Here is a quick run down of what you need to get started:

    1. Every HTTP request in a rails app is routed to exactly one controller method. That controller method fulfills the request by either rendering some content or issuing a 302 redirect (which causes the browser to issue a different request).

    2. A route in ROR describes how each HTTP request is mapped to each controller method. HTTP requests are mapped based on two attributes: the requested url and the HTTP verb (GET POST PUT etc).

    3. When you do resources :homes in your routes.rb file your are telling Rails you have a controller called HomesController you are asking Rails to set up its conventional RESTful routes for that controller. These are as follows:

    HTTP GET on /homes url

    • mapped to the index method
    • usually used to list all of the homes records

    HTTP GET on /homes/1 url

    • mapped to the show method
    • usually used to show the home record with id = 1

    HTTP GET on /homes/new url

    • mapped to the new method
    • usually used render a form for creating a new home record

    HTTP POST on /homes url

    • mapped to the create method
    • where the new form is submitted to
    • used to create a new home record
    • usually responds with a redirect

    HTTP GET on /homes/1/edit url

    • mapped to the edit method
    • usually used to render a form for editing home record with id=1

    HTTP PUT on /homes/1 url

    • mapped to the update method
    • where the edit form is submitted to
    • used to edit the record with id=1
    • usually responds with a redirect

    HTTP DELETE on /homes/1 url

    • mapped to the delete method
    • usually used to destroy the record with id=1
    • usually responds with a redirect
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
I'm having trouble keeping the paragraph square between the quote marks. In firefox the
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am trying to render a haml file in a javascript response like so:
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I need to clean up various Word 'smart' characters in user input, including but
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out

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.